forked from MLH-Fellowship/project-team-pythonic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.prod.yml
38 lines (35 loc) · 1.13 KB
/
docker-compose.prod.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
version: "3" # docker compose file version
services: # each is a container
myportfolio:
container_name: myportfolio
build: . # build from Dockerfile at current dir
restart: always # on reboot or error
env_file:
- .env
depends_on:
- mysql # service starts up after mysql service is up
mysql:
container_name: mysql
image: mariadb # for lower resource image
restart: always
env_file:
- .env
volumes:
- mydatabase:/var/lib/mysql # continues even if container recreated
nginx:
container_name: nginx
image: jonasal/nginx-certbot
restart: always
environment: # environment variable to generate certificates
ports: # bind ports to the internet
- 80:80 # HTTP
- 443:443 # HTTPS
volumes:
- nginx_secrets:/etc/letsencrypt # store generated certificate files so they're not lost upon restart
- ./user_conf.d:/etc/nginx/user_conf.d # map nginx configuration files under the directory "user_conf.d" into container
depends_on:
- myportfolio
volumes: # define volume names
mydatabase:
nginx_secrets: