Disbox
Browse files- Dockerfile +32 -0
- README.md +4 -3
- supervisor.conf +56 -0
Dockerfile
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM node:18-alpine
|
2 |
+
|
3 |
+
ENV USER ${USER:-node}
|
4 |
+
ENV USER_ID ${USER_ID:-1000}
|
5 |
+
ARG ver
|
6 |
+
WORKDIR /app
|
7 |
+
|
8 |
+
COPY . /app
|
9 |
+
|
10 |
+
RUN apk add curl wget supervisor git py3-flask
|
11 |
+
|
12 |
+
## Disbox
|
13 |
+
RUN git clone https://github.com/DisboxApp/server && git clone https://github.com/DisboxApp/web
|
14 |
+
RUN chmod -R 777 server && cd server && \
|
15 |
+
npm install
|
16 |
+
RUN cd /app && chmod -R 777 web && cd web && \
|
17 |
+
npm install && cd /app
|
18 |
+
RUN chmod -R 777 server && chmod -R 777 web
|
19 |
+
RUN curl -L https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64 -o cloudflared && \
|
20 |
+
chmod +x cloudflared
|
21 |
+
|
22 |
+
|
23 |
+
|
24 |
+
RUN mkdir -p /var/run/supervisor /var/log/supervisor
|
25 |
+
RUN chown "${USER_ID}:${USER_ID}" /var/run/supervisor /var/log/supervisor
|
26 |
+
RUN chmod 777 /tmp
|
27 |
+
|
28 |
+
USER $USER
|
29 |
+
|
30 |
+
EXPOSE 5000
|
31 |
+
CMD pip install Supervisor
|
32 |
+
CMD /usr/bin/supervisord -c supervisor.conf
|
README.md
CHANGED
@@ -1,10 +1,11 @@
|
|
1 |
---
|
2 |
title: Disbox
|
3 |
-
emoji:
|
4 |
-
colorFrom:
|
5 |
-
colorTo:
|
6 |
sdk: docker
|
7 |
pinned: false
|
|
|
8 |
---
|
9 |
|
10 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
1 |
---
|
2 |
title: Disbox
|
3 |
+
emoji: 🐢
|
4 |
+
colorFrom: green
|
5 |
+
colorTo: pink
|
6 |
sdk: docker
|
7 |
pinned: false
|
8 |
+
app_port: 3000
|
9 |
---
|
10 |
|
11 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
supervisor.conf
ADDED
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
[supervisord]
|
2 |
+
logfile=/var/log/supervisor/supervisord.log
|
3 |
+
logfile_maxbytes=10MB
|
4 |
+
logfile_backups=10
|
5 |
+
loglevel=info
|
6 |
+
pidfile=/var/run/supervisor/supervisord.pid
|
7 |
+
nodaemon=true
|
8 |
+
childlogdir=/var/log/supervisor
|
9 |
+
|
10 |
+
[inet_http_server]
|
11 |
+
port=127.0.0.1:9007
|
12 |
+
|
13 |
+
[rpcinterface:supervisor]
|
14 |
+
supervisor.rpcinterface_factory=supervisor.rpcinterface:make_main_rpcinterface
|
15 |
+
|
16 |
+
[supervisorctl]
|
17 |
+
serverurl=http://127.0.0.1:9007
|
18 |
+
|
19 |
+
|
20 |
+
|
21 |
+
[program:cloudflared]
|
22 |
+
command=/app/cloudflared tunnel --no-autoupdate run --token %(ENV_CF_TOKEN)s
|
23 |
+
directory=/app
|
24 |
+
stdout_logfile=/dev/stdout
|
25 |
+
stderr_logfile=/dev/stderr
|
26 |
+
autostart=true
|
27 |
+
autorestart=true
|
28 |
+
startsecs=5
|
29 |
+
stopwaitsecs = 5
|
30 |
+
killasgroup=true
|
31 |
+
|
32 |
+
|
33 |
+
|
34 |
+
[program:Disbox_server]
|
35 |
+
command=node disbox-server.js
|
36 |
+
directory=/app/server
|
37 |
+
stdout_logfile=/dev/stdout
|
38 |
+
stderr_logfile=/dev/stderr
|
39 |
+
autostart=true
|
40 |
+
autorestart=true
|
41 |
+
startsecs=5
|
42 |
+
stopwaitsecs = 5
|
43 |
+
killasgroup=true
|
44 |
+
|
45 |
+
|
46 |
+
|
47 |
+
[program:Disbox_client]
|
48 |
+
command=npm start
|
49 |
+
directory=/app/web
|
50 |
+
stdout_logfile=/dev/stdout
|
51 |
+
stderr_logfile=/dev/stderr
|
52 |
+
autostart=true
|
53 |
+
autorestart=true
|
54 |
+
startsecs=5
|
55 |
+
stopwaitsecs = 5
|
56 |
+
killasgroup=true
|