27 lines
863 B
Docker
27 lines
863 B
Docker
FROM nginx:alpine
|
|
|
|
# Create necessary directories and set permissions
|
|
RUN mkdir -p /usr/share/nginx/html \
|
|
&& mkdir -p /var/log/nginx \
|
|
&& mkdir -p /var/cache/nginx \
|
|
&& chown -R nginx:nginx /usr/share/nginx/html \
|
|
&& chown -R nginx:nginx /var/log/nginx \
|
|
&& chown -R nginx:nginx /var/cache/nginx \
|
|
&& chmod -R 755 /usr/share/nginx/html
|
|
|
|
# Copy files - notice the change in the source path
|
|
COPY supervisor/html/* /usr/share/nginx/html/
|
|
COPY supervisor/nginx/default.conf /etc/nginx/conf.d/default.conf
|
|
|
|
# Set final permissions
|
|
RUN chown -R nginx:nginx /usr/share/nginx/html \
|
|
&& chmod -R 755 /usr/share/nginx/html \
|
|
&& touch /var/log/nginx/access.log \
|
|
&& touch /var/log/nginx/error.log \
|
|
&& chown -R nginx:nginx /var/log/nginx \
|
|
&& chown -R nginx:nginx /etc/nginx/conf.d
|
|
|
|
EXPOSE 80
|
|
|
|
CMD ["nginx", "-g", "daemon off;"]
|