Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +8 -7
Dockerfile
CHANGED
@@ -15,7 +15,7 @@ WORKDIR /app/frontend
|
|
15 |
RUN npm run build
|
16 |
|
17 |
FROM python:3.10.13-slim-bullseye
|
18 |
-
RUN apt-get update && apt-get install -y nginx
|
19 |
&& rm -rf /var/lib/apt/lists/*
|
20 |
|
21 |
RUN python3 -m pip install --upgrade pip \
|
@@ -24,11 +24,11 @@ RUN python3 -m pip install --upgrade pip \
|
|
24 |
COPY ./backend ./backend
|
25 |
RUN pip install -r ./backend/requirements.txt
|
26 |
|
27 |
-
# Ensure necessary permissions
|
28 |
RUN chmod -R 755 /var/log/nginx && \
|
29 |
chmod -R 755 /var/lib/nginx && \
|
30 |
-
|
31 |
-
chown -R
|
32 |
|
33 |
# Step #3: configure nginx and flask
|
34 |
COPY --from=build-step /app/frontend/build /usr/share/nginx/html
|
@@ -36,10 +36,11 @@ COPY deployment/docker/nginx.conf /etc/nginx/sites-enabled/default
|
|
36 |
COPY deployment/docker/serve.sh .
|
37 |
RUN chmod a+x ./serve.sh
|
38 |
|
39 |
-
#
|
40 |
-
USER www-data
|
41 |
-
|
42 |
EXPOSE 80
|
43 |
|
|
|
|
|
|
|
44 |
ENTRYPOINT ["/bin/bash"]
|
45 |
CMD ["./serve.sh"]
|
|
|
15 |
RUN npm run build
|
16 |
|
17 |
FROM python:3.10.13-slim-bullseye
|
18 |
+
RUN apt-get update && apt-get install -y nginx \
|
19 |
&& rm -rf /var/lib/apt/lists/*
|
20 |
|
21 |
RUN python3 -m pip install --upgrade pip \
|
|
|
24 |
COPY ./backend ./backend
|
25 |
RUN pip install -r ./backend/requirements.txt
|
26 |
|
27 |
+
# Ensure necessary permissions and create directories
|
28 |
RUN chmod -R 755 /var/log/nginx && \
|
29 |
chmod -R 755 /var/lib/nginx && \
|
30 |
+
mkdir -p /var/lib/nginx/body && \
|
31 |
+
chown -R root:root /var/log/nginx /var/lib/nginx /usr/share/nginx/html
|
32 |
|
33 |
# Step #3: configure nginx and flask
|
34 |
COPY --from=build-step /app/frontend/build /usr/share/nginx/html
|
|
|
36 |
COPY deployment/docker/serve.sh .
|
37 |
RUN chmod a+x ./serve.sh
|
38 |
|
39 |
+
# Expose port 80
|
|
|
|
|
40 |
EXPOSE 80
|
41 |
|
42 |
+
# Run as root user
|
43 |
+
USER root
|
44 |
+
|
45 |
ENTRYPOINT ["/bin/bash"]
|
46 |
CMD ["./serve.sh"]
|