-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
118 lines (109 loc) · 2.3 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
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
version: "3.7"
services:
app:
image: keygo
build: .
volumes:
- .:/src
ports:
- "1323:1323"
- "2345:2345"
env_file:
- .env
environment:
ADDR: 0.0.0.0
APP_NAME: keygo
DATABASE_URL: postgres://keygo:keygo@db:5432/keygo?sslmode=disable
GO_ENV: development
SUPPORT_EMAIL: forget_about_it@example.com
depends_on:
db:
condition: service_healthy
working_dir: /src
ui-app:
image: node:18
volumes:
- .:/app
working_dir: /app
ports:
- "35729:35729"
command: npm run docker-dev
user: 1000:1000
test:
build: .
image: keygo
volumes:
- .:/src
env_file:
- test.env
environment:
DATABASE_URL: postgres://keygo:keygo@testdb:5432/keygo?sslmode=disable
GO_ENV: test
HISTCONTROL: ignoreboth
depends_on:
testdb:
condition: service_healthy
working_dir: /src
command: go test -p 1 ./...
db_base:
image: postgres:11.6
volumes:
- ./db-init.sh:/docker-entrypoint-initdb.d/db-init.sh
environment:
POSTGRES_USER: keygo
POSTGRES_PASSWORD: keygo
POSTGRES_DB: keygo
healthcheck:
test: ["CMD-SHELL", "pg_isready", "-d", "keygo"]
start_period: 1s
interval: 500ms
timeout: 100ms
retries: 3
db:
extends:
service: db_base
ports:
- "5433:5432"
testdb:
extends:
service: db_base
ports:
- "5432:5432"
# http://localhost:8000/?pgsql=db&username=keygo&db=keygo&ns=public
adminer:
image: adminer
depends_on:
- db
ports:
- 8000:8080
environment:
ADMINER_DEFAULT_DB_DRIVER: pgsql
ADMINER_DEFAULT_DB_HOST: db
ADMINER_DEFAULT_DB_NAME: keygo
swagger:
image: quay.io/goswagger/swagger:latest
ports:
- "8080:8080"
volumes:
- .:/app
working_dir: /app
#
# redoc:
# build:
# context: .
# dockerfile: Dockerfile-redoc-cli
# volumes:
# - ./swagger:/data
#
# docs:
# build:
# context: .
# dockerfile: Dockerfile-api-docs
# Start this container to use https for development. Set variables in proxy.env and change HOST in .env
proxy:
image: silintl/traefik-https-proxy:latest
ports:
- "80:80"
- "443:443"
env_file:
- ./proxy.env