-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
31 lines (23 loc) · 831 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Use official Nginx Alpine image for a lightweight base
FROM nginx:alpine
# Metadata
LABEL maintainer="bigsk1"
LABEL description="Netflix Secret Codes Webpage"
# Remove default Nginx HTML files
RUN rm -rf /usr/share/nginx/html/*
# Copy the built HTML file into the Nginx directory
COPY html/ /usr/share/nginx/html/
# Copy custom Nginx configuration
COPY nginx.conf /etc/nginx/nginx.conf
# Set permissions for security
RUN chown -R nginx:nginx /usr/share/nginx/html && \
chmod -R 755 /usr/share/nginx/html && \
chown nginx:nginx /etc/nginx/nginx.conf && \
chmod 644 /etc/nginx/nginx.conf
# Harden Nginx by removing unnecessary tools and setting secure defaults
RUN apk update && apk upgrade && \
rm -rf /var/cache/apk/*
# Expose port 80
EXPOSE 80
# Run Nginx in foreground
CMD ["nginx", "-g", "daemon off;"]