File size: 439 Bytes
95e0c4c
 
93613c3
 
 
 
95e0c4c
 
93613c3
95e0c4c
 
93613c3
95e0c4c
 
 
93613c3
95e0c4c
 
93613c3
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
FROM nginx:alpine

# Install shadow package to get useradd command
RUN apk add --no-cache shadow

# Add a new user
RUN useradd -m -u 1000 user

# Set the working directory
WORKDIR /app

# Copy the HTML and nginx configuration files
COPY index.html /usr/share/nginx/html
COPY nginx.conf /etc/nginx/nginx.conf

# Expose port 7860
EXPOSE 7860

# Start nginx as root but serve files as non-root user
CMD ["sh", "-c", "nginx -g 'daemon off;'"]