hequ commited on
Commit
c090f90
·
verified ·
1 Parent(s): c27fff8

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -9
Dockerfile CHANGED
@@ -3,15 +3,17 @@ WORKDIR /app/web/admin-spa
3
 
4
  COPY web/admin-spa/package*.json ./
5
  RUN npm ci
 
6
  COPY web/admin-spa/ ./
7
  RUN npm run build
8
 
9
 
10
  FROM node:18-alpine
11
 
12
- LABEL maintainer="you@example.com"
13
- LABEL description="123"
14
- LABEL version="1.0.0"
 
15
 
16
  WORKDIR /app
17
 
@@ -24,15 +26,16 @@ RUN python3 -m venv /opt/venv && \
24
  ENV PATH="/opt/venv/bin:${PATH}"
25
 
26
  COPY package*.json ./
27
- RUN npm ci --only=production && npm cache clean --force
28
 
29
  COPY . .
30
 
31
  COPY --from=frontend-builder /app/web/admin-spa/dist /app/web/admin-spa/dist
32
- COPY tools/hf_backup.py /app/tools/hf_backup.py
33
- COPY tools/hf-backup.sh /app/tools/hf-backup.sh
34
- RUN chmod +x /app/tools/hf-backup.sh || true
35
 
 
 
 
 
36
  COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
37
  RUN chmod +x /usr/local/bin/docker-entrypoint.sh
38
 
@@ -42,14 +45,13 @@ RUN if [ ! -f "/app/config/config.js" ] && [ -f "/app/config/config.example.js"
42
  cp /app/config/config.example.js /app/config/config.js; \
43
  fi
44
 
 
45
  ENV HOST=0.0.0.0
46
  ENV PORT=7860
47
 
48
  EXPOSE 7860
49
-
50
  HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
51
  CMD sh -c 'curl -fsS "http://127.0.0.1:${PORT:-7860}/health" || exit 1'
52
 
53
  ENTRYPOINT ["dumb-init", "--", "/usr/local/bin/docker-entrypoint.sh"]
54
-
55
  CMD ["node", "src/app.js"]
 
3
 
4
  COPY web/admin-spa/package*.json ./
5
  RUN npm ci
6
+
7
  COPY web/admin-spa/ ./
8
  RUN npm run build
9
 
10
 
11
  FROM node:18-alpine
12
 
13
+ LABEL org.opencontainers.image.title="123"
14
+ LABEL org.opencontainers.image.description="1234"
15
+ LABEL org.opencontainers.image.version="1.0.0"
16
+ LABEL maintainer="123@example.com"
17
 
18
  WORKDIR /app
19
 
 
26
  ENV PATH="/opt/venv/bin:${PATH}"
27
 
28
  COPY package*.json ./
29
+ RUN npm ci --omit=dev && npm cache clean --force
30
 
31
  COPY . .
32
 
33
  COPY --from=frontend-builder /app/web/admin-spa/dist /app/web/admin-spa/dist
 
 
 
34
 
35
+ # COPY tools/hf_backup.py /app/tools/hf_backup.py
36
+ # COPY tools/hf-backup.sh /app/tools/hf-backup.sh
37
+
38
+ RUN chmod +x /app/tools/hf-backup.sh || true
39
  COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
40
  RUN chmod +x /usr/local/bin/docker-entrypoint.sh
41
 
 
45
  cp /app/config/config.example.js /app/config/config.js; \
46
  fi
47
 
48
+ ENV NODE_ENV=production
49
  ENV HOST=0.0.0.0
50
  ENV PORT=7860
51
 
52
  EXPOSE 7860
 
53
  HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
54
  CMD sh -c 'curl -fsS "http://127.0.0.1:${PORT:-7860}/health" || exit 1'
55
 
56
  ENTRYPOINT ["dumb-init", "--", "/usr/local/bin/docker-entrypoint.sh"]
 
57
  CMD ["node", "src/app.js"]