This assumes the following structure:
|- Root
| docker-compose.yml
| nginx -
| Dockerfile
| nginx.conf
| data -
| www
| images
| version: '3' | |
| services: | |
| nginx: | |
| build: | |
| context: ./nginx | |
| dockerfile: Dockerfile | |
| ports: | |
| - "9988:80" | |
| volumes: | |
| - "./nginx/data:/data" | |
| # Set base image | |
| FROM nginx | |
| # Who run it? | |
| LABEL MAINTAINER="Tim Roberts" | |
| # Move nginx.conf to container | |
| COPY ./nginx.conf /etc/nginx/nginx.conf |
| events { | |
| worker_connections 4096; ## Default: 1024 | |
| } | |
| http { | |
| server { | |
| location / { | |
| root /data/www; | |
| } | |
| location /images/ { | |
| root /data; | |
| } | |
| } | |
| } |