martynka commited on
Commit
7ea4fdd
·
verified ·
1 Parent(s): 2d01896

Create mainfile.docker

Browse files
Files changed (1) hide show
  1. removed/mainfile.docker +61 -0
removed/mainfile.docker ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Start from the original repo
2
+ FROM ghcr.io/danny-avila/librechat-dev:latest
3
+
4
+ # Install dependencies
5
+ USER root
6
+ RUN apk update && apk add --no-cache \
7
+ caddy \
8
+ python3 \
9
+ py3-pip \
10
+ py3-dotenv \
11
+ git && \
12
+ pip install flask pymongo[srv] --break-system-packages
13
+
14
+ # Copy configuration files
15
+ COPY config.yaml /app/librechat.yaml
16
+ COPY Caddyfile /app/caddy/Caddyfile
17
+ COPY start-temp.sh /app/start.sh
18
+ RUN chmod +x /app/start.sh
19
+
20
+ # Create directory structure
21
+ RUN mkdir -p \
22
+ /app/sudo/{templates,static} \
23
+ /app/uploads/temp \
24
+ /app/client/public/images/temp \
25
+ /app/api/logs \
26
+ /app/data \
27
+ /app/caddy && \
28
+ chmod -R 777 \
29
+ /app/uploads/temp \
30
+ /app/client/public/images \
31
+ /app/api/logs \
32
+ /app/data
33
+
34
+ # Copy application files
35
+ COPY index-temp.html /app/sudo/templates/index.html
36
+ COPY app-temp.py /app/sudo/app.py
37
+
38
+ # Set environment variables (use HF-specific vars where possible)
39
+ ENV HOST=0.0.0.0 \
40
+ PORT=7860 \
41
+ SESSION_EXPIRY=900000 \
42
+ REFRESH_TOKEN_EXPIRY=604800000 \
43
+ SEARCH=true \
44
+ MEILI_NO_ANALYTICS=true \
45
+ MEILI_HOST=https://martynka-meilisearch.hf.space \
46
+ CONFIG_PATH=/app/librechat.yaml \
47
+ CUSTOM_FOOTER=EasierIT \
48
+ NODE_ENV=production
49
+
50
+ # Install additional dependencies
51
+ RUN cd /app/api && npm install
52
+
53
+ # Expose the correct port for HF Spaces
54
+ EXPOSE 7860
55
+
56
+ # Health check (recommended for HF Spaces)
57
+ HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
58
+ CMD curl -f http://localhost:7860 || exit 1
59
+
60
+ # Start command
61
+ CMD ["/app/start.sh"]