22 lines
524 B
Docker
22 lines
524 B
Docker
# Nginx alpine base image
|
|
FROM nginx:alpine
|
|
|
|
# Remove default nginx config
|
|
RUN rm /etc/nginx/conf.d/default.conf
|
|
|
|
# Copy our custom nginx config
|
|
COPY nginx/default.conf /etc/nginx/conf.d/default.conf
|
|
|
|
# Create directories for static and media files
|
|
RUN mkdir -p /app/staticfiles /app/media
|
|
|
|
# Expose port 80
|
|
EXPOSE 80
|
|
|
|
# Health check
|
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
|
|
CMD wget --quiet --tries=1 --spider http://localhost/ || exit 1
|
|
|
|
# Start nginx
|
|
CMD ["nginx", "-g", "daemon off;"]
|