lemonlink/Dummy Sites/Dockerfile

36 lines
872 B
Docker

# Use nginx alpine as base image for a lightweight container
FROM nginx:alpine
# Remove default nginx website
RUN rm -rf /usr/share/nginx/html/*
# Copy main dashboard
COPY index.html /usr/share/nginx/html/
# Copy all service pages
COPY services/ /usr/share/nginx/html/services/
# Create a custom nginx config
RUN echo 'server { \
listen 80; \
server_name localhost; \
root /usr/share/nginx/html; \
index index.html; \
\
location / { \
try_files $uri $uri/ =404; \
} \
\
# Enable gzip compression \
gzip on; \
gzip_vary on; \
gzip_min_length 1024; \
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript; \
}' > /etc/nginx/conf.d/default.conf
# Expose port 80
EXPOSE 80
# Start nginx
CMD ["nginx", "-g", "daemon off;"]