-
Notifications
You must be signed in to change notification settings - Fork 208
/
docker-compose.yml
47 lines (43 loc) · 1.14 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
version: "3.3"
services:
app:
build:
context: services/app
dockerfile: Dockerfile.dev
working_dir: /app
env_file: .env
command: mix phx.server
environment:
- "USER=${USER}"
ports:
- "${CODEBATTLE_PORT}:${CODEBATTLE_PORT}"
- "8080:8080"
volumes:
- "./services/app:/app:delegated"
- "~/.bash_history:/root/.bash_history:delegated"
- ".bashrc:/root/.bashrc:delegated"
- "/var/run/docker.sock:/var/run/docker.sock:cached"
- "/var/tmp:/var/tmp:delegated"
- "/tmp:/tmp:delegated"
depends_on:
- db
db:
image: postgres:12-alpine
environment:
POSTGRES_USER: ${CODEBATTLE_DB_USERNAME}
POSTGRES_PASSWORD: ${CODEBATTLE_DB_PASSWORD}
volumes:
- pg_data:/var/lib/postgresql/data
# same db but forwards port to host
db-local:
image: postgres:12-alpine
ports:
- "5432:${CODEBATTLE_DB_PORT}"
environment:
POSTGRES_USER: ${CODEBATTLE_DB_USERNAME}
POSTGRES_PASSWORD: ${CODEBATTLE_DB_PASSWORD}
command: postgres -c 'max_connections=1000'
volumes:
- pg_data:/var/lib/postgresql/data
volumes:
pg_data: