Spaces:
Build error
Build error
Update Dockerfile
Browse files- Dockerfile +11 -9
Dockerfile
CHANGED
@@ -5,10 +5,11 @@ RUN git clone https://github.com/langgenius/dify.git .
|
|
5 |
|
6 |
# Web builder stage
|
7 |
FROM node:20.11-alpine3.19 AS web-builder
|
8 |
-
WORKDIR /app
|
9 |
|
10 |
# Copy repository web files
|
11 |
-
COPY --from=repo /app/web ./
|
|
|
12 |
|
13 |
# Configure build environment
|
14 |
ENV NODE_OPTIONS="--max_old_space_size=2048" \
|
@@ -30,10 +31,11 @@ RUN apt-get update && \
|
|
30 |
git \
|
31 |
&& rm -rf /var/lib/apt/lists/*
|
32 |
|
33 |
-
WORKDIR /app
|
34 |
|
35 |
# Copy repository API files
|
36 |
-
COPY --from=repo /app/api ./
|
|
|
37 |
|
38 |
# Install poetry and dependencies
|
39 |
RUN pip install --no-cache-dir poetry && \
|
@@ -61,11 +63,15 @@ RUN mkdir -p api web storage/files && chown -R user:user /app
|
|
61 |
|
62 |
# Copy built artifacts
|
63 |
COPY --from=python-builder --chown=user /usr/local/lib/python3.10/site-packages /usr/local/lib/python3.10/site-packages
|
64 |
-
COPY --from=
|
65 |
COPY --from=web-builder --chown=user /app/web/.next /app/web/.next
|
66 |
COPY --from=web-builder --chown=user /app/web/public /app/web/public
|
67 |
COPY --from=web-builder --chown=user /app/web/package.json /app/web/package.json
|
68 |
|
|
|
|
|
|
|
|
|
69 |
# Install additional Python packages
|
70 |
RUN pip install --no-cache-dir gunicorn gevent psycopg2-binary redis
|
71 |
|
@@ -86,10 +92,6 @@ USER user
|
|
86 |
# Expose Hugging Face required port
|
87 |
EXPOSE 7860
|
88 |
|
89 |
-
# Copy and setup entrypoint
|
90 |
-
COPY --from=repo --chown=user /app/docker/entrypoint.sh /app/entrypoint.sh
|
91 |
-
RUN chmod +x /app/entrypoint.sh
|
92 |
-
|
93 |
WORKDIR /app
|
94 |
|
95 |
CMD ["./entrypoint.sh"]
|
|
|
5 |
|
6 |
# Web builder stage
|
7 |
FROM node:20.11-alpine3.19 AS web-builder
|
8 |
+
WORKDIR /app
|
9 |
|
10 |
# Copy repository web files
|
11 |
+
COPY --from=repo /app/web ./web/
|
12 |
+
WORKDIR /app/web
|
13 |
|
14 |
# Configure build environment
|
15 |
ENV NODE_OPTIONS="--max_old_space_size=2048" \
|
|
|
31 |
git \
|
32 |
&& rm -rf /var/lib/apt/lists/*
|
33 |
|
34 |
+
WORKDIR /app
|
35 |
|
36 |
# Copy repository API files
|
37 |
+
COPY --from=repo /app/api ./api/
|
38 |
+
WORKDIR /app/api
|
39 |
|
40 |
# Install poetry and dependencies
|
41 |
RUN pip install --no-cache-dir poetry && \
|
|
|
63 |
|
64 |
# Copy built artifacts
|
65 |
COPY --from=python-builder --chown=user /usr/local/lib/python3.10/site-packages /usr/local/lib/python3.10/site-packages
|
66 |
+
COPY --from=python-builder --chown=user /app/api /app/api/
|
67 |
COPY --from=web-builder --chown=user /app/web/.next /app/web/.next
|
68 |
COPY --from=web-builder --chown=user /app/web/public /app/web/public
|
69 |
COPY --from=web-builder --chown=user /app/web/package.json /app/web/package.json
|
70 |
|
71 |
+
# Copy entrypoint script from repo
|
72 |
+
COPY --from=repo --chown=user /app/docker/api/entrypoint.sh /app/entrypoint.sh
|
73 |
+
RUN chmod +x /app/entrypoint.sh
|
74 |
+
|
75 |
# Install additional Python packages
|
76 |
RUN pip install --no-cache-dir gunicorn gevent psycopg2-binary redis
|
77 |
|
|
|
92 |
# Expose Hugging Face required port
|
93 |
EXPOSE 7860
|
94 |
|
|
|
|
|
|
|
|
|
95 |
WORKDIR /app
|
96 |
|
97 |
CMD ["./entrypoint.sh"]
|