-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
72 lines (66 loc) · 1.67 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
version: "3.1"
services:
postgres:
image: postgres:latest
container_name: postgres
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- PGDATA=/var/lib/postgresql/data
volumes:
- pgdata:/var/lib/postgresql/data
ports:
- 5432:5432
liquibase:
depends_on:
- postgres
container_name: liquibase
image: liquibase/liquibase
tty: true
environment:
- POSTGRES_HOST=postgres
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
volumes:
- ./liquibase/migrations.yaml:/liquibase/changelog/migrations.yaml
command: bash -c 'echo N |liquibase
--url=jdbc:postgresql://$${POSTGRES_HOST}:5432/$${POSTGRES_DB}
--username=$${POSTGRES_USER}
--password=$${POSTGRES_PASSWORD}
--classpath=/liquibase/changelog
--changeLogFile=migrations.yaml update'
# used as base for all services
test: &defaults
build:
context: .
target: base
working_dir: /app/
command: go test -v ./...
environment:
- ENVIRONMENT=development
- PORT=80 # dont forget when change this value here &&&
- CGO_ENABLED=0
- GOOS=linux
volumes:
- .:/app/
- go_packages:/go
# include all information in test and
# add the command to run
app:
<<: *defaults
command: go run main.go
ports:
- 8080:80 # ***update value here
# use all configuration probided in test
# and use a stand-alone image to run tests in Circle-ci workflow
ci:
<<: *defaults
build:
context: .
target: ci
volumes: []
volumes:
pgdata: {}
go_packages: {}