-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
88 lines (80 loc) · 1.79 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
84
85
86
87
88
version: "3.7"
x-app_env: &app_env local
x-pg-host: &pg-host pg
x-pg-port: &pg-port 5432
x-pg-user: &pg-user app
x-pg-name: &pg-name app
x-pg-password: &pg-password pass
x-pg-uri: &pg-uri postgres://app:pass@pg:5432/app
x-sqlite-uri: &sqlite-uri sqlite3://./.tmp/data.db
networks:
pg:
driver: bridge
services:
pg:
image: postgres:latest
# restart: unless-stopped
networks:
- pg
ports:
- 5432:5432
# expose:
# - 5432
environment:
POSTGRES_USER: *pg-user
POSTGRES_DB: *pg-name
POSTGRES_PASSWORD: *pg-password
#--------------------------------------------------------------------------
# DB admin
#--------------------------------------------------------------------------
# adminer:
# image: adminer
# restart: unless-stopped
# networks:
# - pg
# ports:
# - 8050:8080
# depends_on:
# - pg
# ----------------------------------------------------------------------------
# App
# ----------------------------------------------------------------------------
# App - test_pg
test_pg:
build:
context: ./
# dockerfile: ./Dockerfile
user: ${CMD_USER:-app}
volumes:
- ./:/app/
networks:
- pg
depends_on:
- pg
environment:
APP_ENV: *app_env
LOG: trace
DB_HOST: *pg-host
DB_PORT: *pg-port
DB_NAME: *pg-name
DB_USERNAME: *pg-user
DB_PASSWORD: *pg-password
DB_URI: *pg-uri
DB_TYPE: pg
command: bash
tty: true
# App - test_sqlite
test_sqlite:
build:
context: ./
# dockerfile: ./Dockerfile
user: ${CMD_USER:-app}
volumes:
- ./:/app/
environment:
APP_ENV: *app_env
LOG: trace
DB_URI: *sqlite-uri
DB_TYPE: sqlite
command: bash
tty: true