Spaces:
Running
Running
Commit
•
cc0f83e
1
Parent(s):
87d3d61
fix
Browse files- Dockerfile +14 -1
Dockerfile
CHANGED
@@ -34,4 +34,17 @@ COPY --from=build /app/dist /usr/share/nginx/html
|
|
34 |
# Replace the default nginx.conf with our configuration
|
35 |
COPY nginx.conf /etc/nginx/conf.d
|
36 |
|
37 |
-
# Change ownership of the
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
# Replace the default nginx.conf with our configuration
|
35 |
COPY nginx.conf /etc/nginx/conf.d
|
36 |
|
37 |
+
# Change ownership of the necessary directories and files to the non-root user
|
38 |
+
RUN chown -R user:user /usr/share/nginx/html /etc/nginx/conf.d /var/cache/nginx /var/log/nginx
|
39 |
+
|
40 |
+
# Ensure the /var/run/nginx.pid file has correct permissions
|
41 |
+
RUN touch /var/run/nginx.pid && chown user:user /var/run/nginx.pid
|
42 |
+
|
43 |
+
# Switch back to the "user" user
|
44 |
+
USER user
|
45 |
+
|
46 |
+
# Expose port 7860
|
47 |
+
EXPOSE 7860
|
48 |
+
|
49 |
+
# Start Nginx server
|
50 |
+
CMD ["nginx", "-g", "daemon off;"]
|