-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose-test.yml
48 lines (48 loc) · 1.58 KB
/
docker-compose-test.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
version: '3.7'
services:
frontend:
image: jy95/sourcecode-front
restart: always
depends_on:
- api
ports:
- "80:3000"
- "443:3000"
environment:
API_SERVER: "http://api:3000"
CDN_SERVER: "http://api:3000/files"
api:
image: jy95/sourcecode_api
restart: always
ports:
- "8080:3000"
depends_on:
- db
environment:
NODE_ENV: production
# To have understandable logs in docker logs
DEBUG: sourcecode_api:error_handler
DATABASE_URL: "postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-jy95}@db:5432/${POSTGRES_DB:-sourcecode}"
DATABASE_SCHEMA: exercises_library
# use a env file if you want to use other values that default ones
# https://docs.docker.com/compose/environment-variables/#the-env_file-configuration-option
volumes:
# For the CDN part of this advanced prototype
- ./sourcecode-api/files:/api/files
db:
image: jy95/sourcecode-postgres
restart: always
ports:
- "5432:5432"
environment:
# use a env file for that part later
# https://docs.docker.com/compose/environment-variables/#the-env_file-configuration-option
POSTGRES_USER: postgres
POSTGRES_PASSWORD: jy95
POSTGRES_DB: sourcecode
POSTGRES_PORT: 5432
volumes:
# the default value is "/var/lib/postgresql/data"
# (https://github.com/docker-library/docs/blob/master/postgres/README.md#pgdata)
# We must create the folder "/tmp/db_data" on the host with the required permisssions
- ./sourcecode-db:/var/lib/postgresql/data