-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yaml
118 lines (109 loc) · 2.9 KB
/
docker-compose.yaml
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# Copyright (c) Ollion
# SPDX-License-Identifier: Apache-2.0
version: "3"
networks:
terrarium:
driver: bridge
name: ${TER_DOCKER_NETWORK:-terrarium}
external: ${TER_DOCKER_NETWORK_EXTERNAL:-false}
volumes:
postgres_data:
name: tr_postgres_data
secrets:
netrc:
file: $HOME/.netrc
services:
postgres:
image: postgres:12
container_name: postgres
networks: [terrarium]
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ${TR_DB_PASSWORD:-}
POSTGRES_DB: ${TR_DB_NAME:-cc_terrarium}
healthcheck:
test: ["CMD", "pg_isready", "-q", "-d", "postgres", "-U", "postgres"]
interval: 3s
timeout: 1s
retries: 3
volumes:
- ./data:/docker-entrypoint-initdb.d
- postgres_data:/var/lib/postgresql/data/
ports:
- "5432:5432"
terrarium-api:
image: cldcvr/terrarium-api
container_name: terrarium-api
networks: [terrarium]
build:
context: .
target: api-runner
cache_from:
- "cldcvr/terrarium-api:latest"
environment:
# DB config
TR_DB_HOST: ${TR_DB_HOST:-postgres}
TR_DB_USER: ${TR_DB_USER:-}
TR_DB_PORT: ${TR_DB_PORT:-}
TR_DB_SSL_MODE: ${TR_DB_SSL_MODE:-}
TR_DB_PASSWORD: ${TR_DB_PASSWORD:-}
# Logging config
TR_LOG_LEVEL: ${TR_LOG_LEVEL:-trace}
TR_LOG_FORMAT: ${TR_LOG_FORMAT:-text}
TR_LOG_PRETTY_PRINT: ${TR_LOG_PRETTY_PRINT:-true}
ports:
- ${TR_SERVER_HTTP_PORT:-3000}:3000
depends_on:
postgres:
condition: service_healthy
farm-harvester:
image: cldcvr/terrarium-farm-harvester
container_name: terrarium-farm-harvester
networks: [terrarium]
build:
context: .
target: farm-harvester
args:
TERRAFORM_VERSION: ${TERRAFORM_VERSION:-latest}
cache_from:
- "cldcvr/terrarium-farm-harvester:latest"
secrets:
- source: netrc
target: /root/.netrc
environment:
# DB config
TR_DB_TYPE: ${TR_DB_TYPE:-postgres}
TR_DB_HOST: ${TR_DB_HOST:-postgres}
TR_DB_USER: ${TR_DB_USER:-}
TR_DB_PORT: ${TR_DB_PORT:-}
TR_DB_SSL_MODE: ${TR_DB_SSL_MODE:-}
TR_DB_PASSWORD: ${TR_DB_PASSWORD:-}
TR_LOG_LEVEL: ${TR_LOG_LEVEL:-}
volumes:
- ./examples/farm:/app/farm
profiles:
- tooling
depends_on:
postgres:
condition: service_healthy
terrarium-unit-test:
image: cldcvr/terrarium-unit-test
container_name: terrarium-unit-test
networks: [terrarium]
build:
context: .
target: unit-test
volumes:
- ./coverage:/usr/src/app/coverage
profiles:
- tooling
environment:
# DB config
TR_DB_HOST: ${TR_DB_HOST:-postgres}
TR_DB_USER: ${TR_DB_USER:-}
TR_DB_PORT: ${TR_DB_PORT:-}
TR_DB_SSL_MODE: ${TR_DB_SSL_MODE:-}
TR_DB_PASSWORD: ${TR_DB_PASSWORD:-}
depends_on:
postgres:
condition: service_healthy