-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
83 lines (81 loc) · 2.27 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
services:
frontend:
profiles: ["production"]
build:
context: ./frontend
dockerfile: Dockerfile
container_name: frontend
restart: unless-stopped
volumes:
- ./certbot/www/:/var/www/certbot # read challenge files from certbot
- ./certbot/conf/:/etc/letsencrypt # read actual certs
# TODO: nginx log volume?
# TODO: configure this if I need to develop live on the Docker instance
# - /app/node_modules
# - ./frontend:/app
ports:
- "80:80"
- "443:443"
networks:
- frontend
environment:
- SERVER_NAME=$SERVER_NAME
- SSL_CERTIFICATE=$SSL_CERTIFICATE
- SSL_CERTIFICATE_KEY=$SSL_CERTIFICATE_KEY
entrypoint: ["/entrypoint.sh"]
command: ["nginx", "-g", "daemon off;"]
graphql-server:
profiles: ["production"]
build:
context: ./graphql-server
dockerfile: Dockerfile
container_name: graphql-server
restart: unless-stopped
environment:
MONGODB_URI: $MONGODB_URI
# ports:
# - "4000:4000"
depends_on:
- mongodb
networks:
- frontend
- backend
mongodb:
container_name: mongodb
image: mongo
restart: unless-stopped
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: example
MONGO_INITDB_DATABASE: raiseyourgame
MONGODB_DATA_DIR: /data/db
MONGODB_LOG_DIR: /dev/null
ports:
- "27017:27017"
# TODO: switch availability based on env
volumes:
- mongodbdata:/data/db
networks:
- backend
# LetsEncrypt certbot; certbot.eff.org
certbot:
# In this context, certbot can't configure nginx directly, so no point
# running it as a service. Instead, while the frontend server is running,
# run the certonly command to write the updated certificates:
#
# sudo docker compose run --rm certbot certonly --webroot --webroot-path /var/www/certbot/ -d raiseyourga.me
profiles: ["certbot"]
image: certbot/certbot:latest
volumes:
- ./certbot/www/:/var/www/certbot # write challenge files for nginx
- ./certbot/conf/:/etc/letsencrypt # write actual certs
networks:
frontend:
driver: bridge
backend:
driver: bridge
volumes:
mongodbdata:
driver: local
nginxdata:
driver: local