File size: 629 Bytes
bafb6c9
 
b2069e9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
bafb6c9
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
FROM nginx:alpine

# Create directories and set permissions first
RUN mkdir -p /var/cache/nginx/client_temp /var/cache/nginx/proxy_temp \
    /var/cache/nginx/fastcgi_temp /var/cache/nginx/uwsgi_temp /var/cache/nginx/scgi_temp \
    && chmod 700 /var/cache/nginx/* \
    && chown -R nginx:nginx /var/cache/nginx

# Copy our custom nginx.conf to replace the default one
COPY nginx.conf /etc/nginx/nginx.conf
RUN chown -R nginx:nginx /etc/nginx

# Clean up default conf
RUN rm -f /etc/nginx/conf.d/default.conf

# Switch to non-root user
USER nginx

# Expose port 7860
EXPOSE 7860

# Start Nginx
CMD ["nginx", "-g", "daemon off;"]