-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathdocker-compose.yml
66 lines (52 loc) · 1.72 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
services:
# service configuration for our dockerized Rails app
netrunner_cards_json:
restart: none
image: registry.digitalocean.com/nsgcr/netrunner-cards-json:${JSON_DATA_VERSION:-latest}
build: https://github.com/NetrunnerDB/netrunner-cards-json.git#main
volumes:
- netrunner-cards-json:/mnt/netrunner-cards-json
nrdb_api_server:
restart: unless-stopped
# Will use the latest image by default, but can be overridden with the API_SERVER_VERSION env var.
image: registry.digitalocean.com/nsgcr/nrdb-api-server:${API_SERVER_VERSION:-latest}
# build the Dockerfile next to this file, tag the built image with above image name
build: .
ports:
- "3000:3000"
networks:
- backend
- null_signal
# sources environment variable configuration for our app
env_file: .env
# rely on the RAILS_ENV value of the host machine
environment:
POSTGRES_PASSWORD: netrunnerdb
RAILS_ENV: $RAILS_ENV
# starts the app container after the DB and netrunner_cards_json containers
depends_on:
- db
- netrunner_cards_json
volumes:
- ./config/database.yml:/var/www/nrdb-api/config/database.yml
- netrunner-cards-json:/netrunner-cards-json
- nrdb-api-logs:/var/www/nrdb-api/log
# service configuration for our database
db:
restart: unless-stopped
image: postgres:14.5-alpine
networks:
- backend
environment:
POSTGRES_PASSWORD: netrunnerdb
# persist the database between containers by storing it in a volume
volumes:
- nrdb-api-postgres:/var/lib/postgresql/data
networks:
backend:
null_signal:
external: true
volumes:
nrdb-api-logs:
nrdb-api-postgres:
netrunner-cards-json: