-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
executable file
·40 lines (38 loc) · 1.32 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
version: "3.9"
services:
nikas:
build:
context: .
dockerfile: ./Dockerfile
image: nikas/website
container_name: nikas-website
restart: unless-stopped
working_dir: /usr/share/nginx/html
volumes:
- .:/usr/share/nginx/html
networks:
- nikas-website
- traefik
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik"
# HTTPS
- "traefik.http.routers.nikas-website.rule=Host(`nikasproject.ir`)"
- "traefik.http.routers.nikas-website.tls.certresolver=letsencrypt"
- "traefik.http.routers.nikas-website.entrypoints=websecure"
- "traefik.http.routers.nikas-website.service=nikas-website"
- "traefik.http.services.nikas-website.loadbalancer.server.port=80"
# HTTP
- "traefik.http.routers.nikas-website-http.rule=Host(`nikasproject.ir`)"
- "traefik.http.routers.nikas-website-http.entrypoints=web"
- "traefik.http.routers.nikas-website-http.middlewares=nikas-website-https@docker"
- "traefik.http.middlewares.nikas-website-https.redirectscheme.scheme=https"
healthcheck:
test: ["CMD-SHELL", "wget -O /dev/null http://localhost || exit 1"]
timeout: 10s
networks:
nikas-website:
external: false
driver: bridge
traefik:
external: true