Update Dockerfile
Browse files- Dockerfile +9 -5
Dockerfile
CHANGED
|
@@ -6,17 +6,22 @@ RUN npm ci
|
|
| 6 |
COPY web/admin-spa/ ./
|
| 7 |
RUN npm run build
|
| 8 |
|
|
|
|
| 9 |
FROM node:18-alpine
|
| 10 |
|
| 11 |
LABEL maintainer="you@example.com"
|
| 12 |
LABEL description="123"
|
| 13 |
LABEL version="1.0.0"
|
| 14 |
|
| 15 |
-
|
| 16 |
|
| 17 |
-
RUN
|
| 18 |
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
COPY package*.json ./
|
| 22 |
RUN npm ci --only=production && npm cache clean --force
|
|
@@ -24,10 +29,9 @@ RUN npm ci --only=production && npm cache clean --force
|
|
| 24 |
COPY . .
|
| 25 |
|
| 26 |
COPY --from=frontend-builder /app/web/admin-spa/dist /app/web/admin-spa/dist
|
| 27 |
-
|
| 28 |
COPY tools/hf_backup.py /app/tools/hf_backup.py
|
| 29 |
COPY tools/hf-backup.sh /app/tools/hf-backup.sh
|
| 30 |
-
RUN chmod +x /app/tools/hf-backup.sh
|
| 31 |
|
| 32 |
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
|
| 33 |
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
|
|
|
|
| 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 |
|
| 18 |
+
RUN apk add --no-cache redis curl dumb-init python3 py3-pip
|
| 19 |
|
| 20 |
+
RUN python3 -m venv /opt/venv && \
|
| 21 |
+
. /opt/venv/bin/activate && \
|
| 22 |
+
pip install --no-cache-dir --upgrade pip && \
|
| 23 |
+
pip install --no-cache-dir huggingface_hub
|
| 24 |
+
ENV PATH="/opt/venv/bin:${PATH}"
|
| 25 |
|
| 26 |
COPY package*.json ./
|
| 27 |
RUN npm ci --only=production && npm cache clean --force
|
|
|
|
| 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
|