1version: "3"
2
3networks:
4  nginx-proxy:
5
6volumes:
7  nginx_conf:
8  nginx_vhost:
9  nginx_html:
10
11services:
12  nginx-proxy:
13    restart: always
14    image: nginx
15    container_name: nginx-proxy
16    ports:
17      - "80:80"    # OPTIONAL: Change "left" number to use different port
18      - "443:443"  # OPTIONAL: Change "left" number to use different port
19    volumes:
20      - "nginx_conf:/etc/nginx/conf.d"
21      - "nginx_vhost:/etc/nginx/vhost.d"
22      - "nginx_html:/usr/share/nginx/html"
23      - "/path/to/certs:/etc/nginx/certs:ro"     # REQUIRED: Change "left" path
24      - "/path/to/htpasswd:/etc/nginx/htpasswd"  # REQUIRED: Change "left" path
25    networks:
26      nginx-proxy
27
28  nginx-gen:
29    restart: always
30    image: jwilder/docker-gen
31    container_name: nginx-gen
32    depends_on:
33      - nginx-proxy
34    volumes:
35      - "/var/run/docker.sock:/tmp/docker.sock:ro" # REQUIRED: On some OSs you will have to change "left" path
36      - "/path/to/nginx.tmpl:/etc/docker-gen/templates/nginx.tmpl:ro" # REQUIRED: Change "left" path. See nginx image docs
37      - "nginx_conf:/etc/nginx/conf.d"
38      - "nginx_vhost:/etc/nginx/vhost.d"
39      - "nginx_html:/usr/share/nginx/html"
40      - "/path/to/certs:/etc/nginx/certs:ro" # REQUIRED: Change "left" path. Use the same path as in nginx-proxy
41      - "/path/to/htpasswd:/etc/nginx/htpasswd" # REQUIRED: Change "left" path. Use the same path as in nginx-proxy
42
43    entrypoint: /usr/local/bin/docker-gen -notify-sighup nginx-proxy -watch -wait 2s:5s /etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf
44    networks:
45      - nginx-proxy
46
47  letsencrypt-nginx-proxy-companion:
48    restart: always
49    image: jrcs/letsencrypt-nginx-proxy-companion
50    container_name: letsencrypt-nginx-proxy-companion
51    depends_on:
52      - nginx-proxy
53      - nginx-gen
54    volumes:
55      - "/var/run/docker.sock:/var/run/docker.sock:ro" # REQUIRED: On some OSs you will have to change "left" path
56      - "nginx_conf:/etc/nginx/conf.d"
57      - "nginx_vhost:/etc/nginx/vhost.d"
58      - "nginx_html:/usr/share/nginx/html"
59      - "/path/to/certs:/etc/nginx/certs:rw" # REQUIRED: Change "left" path. Use the same path as in nginx-proxy
60      - "/path/to/htpasswd:/etc/nginx/htpasswd" # REQUIRED: Change "left" path. Use the same path as in nginx-proxy
61    environment:
62      - NGINX_DOCKER_GEN_CONTAINER=nginx-gen
63      - NGINX_PROXY_CONTAINER=nginx-proxy
64    networks:
65      - nginx-proxy
66
67  dokuwiki:
68    #image: mprasil/dokuwiki:latest
69    build:
70      context: ../dokuwikiapp
71      args:
72        - MAXPOST=30M  # OPTIONAL: Change value to allow upload of bigger/smaller files
73        - MAXFILE=30M  # OPTIONAL: Change value to allow upload of bigger/smaller files
74    container_name: dokuwiki
75    #ports:
76    #  - "80:80"
77    restart:
78      always
79    depends_on:
80      - nginx-proxy
81      - nginx-gen
82      - letsencrypt-nginx-proxy-companion
83    volumes:
84      - /path/to/data:/dokuwiki/data           # REQUIRED: Change "left" path
85      - /path/to/conf:/dokuwiki/conf           # REQUIRED: Change "left" path
86      - /path/to/plugins:/dokuwiki/lib/plugins # REQUIRED: Change "left" path
87      - /path/to/tpl:/dokuwiki/lib/tpl         # REQUIRED: Change "left" path
88      - /path/to/logs:/var/log                 # REQUIRED: Change "left" path
89    expose:
90      - 80
91    environment:
92      - VIRTUAL_HOST=subdomain.domain.org      # REQUIRED: Change to meet your needs
93      - VIRTUAL_NETWORK=nginx-proxy
94      - VIRTUAL_PORT=80
95      - VIRTUAL_PROTO=http
96      - LETSENCRYPT_HOST=subdomain.domain.org  # REQUIRED: Change to meet your needs
97      - LETSENCRYPT_EMAIL=mail@domain.org      # REQUIRED: Change to meet your needs
98    networks:
99      - nginx-proxy
100