-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose_local.yml
102 lines (93 loc) · 2.86 KB
/
docker-compose_local.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
version: '3.7'
# This is for local testing, it has no TLS, local db, emails configured for mailhog etc
# DB config
x-dbconfig_env: &dbconfig_env
DB_HOST: 172.17.0.1 # docker internal ip, we could use links but this way the db can be connected to from the docker host
DB_USER: &dbuser postgres
DB_DATABASE: &dbname pvarki
DB_PASSWORD: &dbpass pvarkipwd # pragma: allowlist secret
DB_PORT: &dbport 58432
# Mailer config (don't ask about some of the key names)
x-mailconfig_env: &mailconfig_env
FIXME_INSTRUCTIONS_RECEIVER_EMAIL: "paavo.pokkinen@hallatek.com"
MAIL_FROM: "testsender@example.com"
#SUPPRESS_SEND: 1 # If you need to suppress for a moment
MAIL_USERNAME: "" # MUST be set even if not used
MAIL_PASSWORD: "" # MUST be set even if not used
USE_CREDENTIALS: "0" # Set to 1 if you need user/pass for the server
MAIL_PORT: &mailhog_smtp 1125 # MUST be explicitly set anyway, 1025 is MailHog default
MAIL_SERVER: "172.17.0.1"
MAIL_STARTTLS: "0" # Try to upgrade to TLS
MAIL_SSL_TLS: "0" # Force TLS
x-security_env: &security_env
JWT_PRIVKEY_PATH: "0"
JWT_PUBKEY_PATH: "/app/jwtRS256.pub"
# Do not call the pipelines from local testing
PIPELINE_SUPPRESS: 1
PIPELINE_SSHKEY_OVERRIDE: "nokey" # we need to define these or the keyvault client will throw exception
PIPELINE_TOKEN_OVERRIDE: "notoken" # we need to define these or the keyvault client will throw exception
services:
db:
image: postgres:15.1
environment:
POSTGRES_USER: *dbuser
POSTGRES_DB: *dbname
POSTGRES_PASSWORD: *dbpass # pragma: allowlist secret
LC_COLLATE: "C.UTF-8"
ports:
- target: 5432
published: *dbport
protocol: tcp
mode: host
healthcheck:
test: "pg_isready --dbname=$$POSTGRES_DB --username=$$POSTGRES_USER -q"
interval: 5s
timeout: 5s
retries: 3
start_period: 5s
volumes:
- 'db_data:/var/lib/postgresql/data'
dbinit:
image: "pvarki/takbackend:migrations${DOCKER_TAG_EXTRA}"
build:
context: .
dockerfile: Dockerfile
target: migrations
environment:
<<: *dbconfig_env
depends_on:
db:
condition: service_healthy
api:
image: "pvarki/takbackend:latest${DOCKER_TAG_EXTRA}"
build:
context: .
dockerfile: Dockerfile
target: production
environment:
<<: [ *dbconfig_env, *mailconfig_env, *security_env ]
volumes:
- ./jwt.pub:/app/jwtRS256.pub
depends_on:
db:
condition: service_healthy
dbinit:
condition: service_completed_successfully
expose:
- 8000
ports:
- "8000:8000"
mailhog:
image: mailhog/mailhog
ports:
- target: 1025
published: *mailhog_smtp
protocol: tcp
mode: host
- target: 8025
published: 8125
protocol: tcp
mode: host
volumes:
db_data:
driver: local