Skip to content

Commit 4854e78

Browse files
Merge pull request #224 from 0xPolygonID/rollcakcdockerfile
fix: dockerfile
2 parents c7d9ace + 32a47f0 commit 4854e78

File tree

1 file changed

+9
-24
lines changed

1 file changed

+9
-24
lines changed

Dockerfile

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,14 @@
1-
# Use a specific version of nginx for better reproducibility
2-
FROM nginx:1.25.3-alpine
1+
#Serve the app with NGINX
2+
FROM nginx:alpine
33

4-
# Add a non-root user for security
5-
RUN adduser -D -H -u 1001 nginxuser && \
6-
chown -R nginxuser:nginxuser /usr/share/nginx/html && \
7-
chown -R nginxuser:nginxuser /var/cache/nginx && \
8-
touch /var/run/nginx.pid && \
9-
chown -R nginxuser:nginxuser /var/run/nginx.pid
4+
# Copy the build files from the build folder to /usr/share/nginx/html
5+
COPY build /usr/share/nginx/html
106

11-
# Copy files with specific ownership
12-
COPY --chown=nginxuser:nginxuser build /usr/share/nginx/html
13-
COPY --chown=nginxuser:nginxuser nginx.conf /etc/nginx/conf.d/default.conf
7+
#Replace default nginx.conf with custom configuration
8+
COPY nginx.conf /etc/nginx/conf.d/default.conf
149

15-
# Set working directory
16-
WORKDIR /usr/share/nginx/html
17-
18-
# Switch to non-root user
19-
USER nginxuser
20-
21-
# Expose port
10+
# Expose the desired port (default is 80 for NGINX)
2211
EXPOSE 80
2312

24-
# Use exec form of CMD for better signal handling
25-
CMD ["nginx", "-g", "daemon off;"]
26-
27-
# Add healthcheck
28-
HEALTHCHECK --interval=30s --timeout=3s \
29-
CMD wget --quiet --tries=1 --spider http://localhost:80/ || exit 1
13+
# Start NGINX
14+
CMD ["nginx", "-g", "daemon off;"]

0 commit comments

Comments
 (0)