Update Dockerfile
Browse files- Dockerfile +9 -2
Dockerfile
CHANGED
@@ -2,7 +2,11 @@ FROM alpine
|
|
2 |
|
3 |
WORKDIR /opt/app
|
4 |
|
5 |
-
RUN apk add --no-cache nodejs
|
|
|
|
|
|
|
|
|
6 |
|
7 |
ADD https://github.com/sub-store-org/Sub-Store/releases/latest/download/sub-store.bundle.js /opt/app/sub-store.bundle.js
|
8 |
|
@@ -12,4 +16,7 @@ RUN unzip dist.zip; mv dist frontend; rm dist.zip
|
|
12 |
|
13 |
RUN chmod 777 -R /opt/app
|
14 |
|
15 |
-
CMD
|
|
|
|
|
|
|
|
2 |
|
3 |
WORKDIR /opt/app
|
4 |
|
5 |
+
RUN apk add --no-cache nodejs curl tzdata
|
6 |
+
|
7 |
+
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
|
8 |
+
|
9 |
+
RUN apk del tzdata
|
10 |
|
11 |
ADD https://github.com/sub-store-org/Sub-Store/releases/latest/download/sub-store.bundle.js /opt/app/sub-store.bundle.js
|
12 |
|
|
|
16 |
|
17 |
RUN chmod 777 -R /opt/app
|
18 |
|
19 |
+
CMD if [ -n "$SUB_STORE_CRON" ]; then \
|
20 |
+
echo "${SUB_STORE_CRON} curl http://127.0.0.1:3000/api/sync/artifacts > /opt/app/data/cron.log 2>&1" > /etc/crontabs/root && crond; \
|
21 |
+
fi; \
|
22 |
+
mkdir -p /opt/app/data; cd /opt/app/data; SUB_STORE_BACKEND_API_HOST=127.0.0.1 SUB_STORE_FRONTEND_HOST=0.0.0.0 SUB_STORE_FRONTEND_PORT=7860 SUB_STORE_FRONTEND_PATH=/opt/app/frontend SUB_STORE_DATA_BASE_PATH=/opt/app/data node /opt/app/sub-store.bundle.js
|