-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
73 lines (73 loc) · 2.05 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
version: "3"
services:
web:
build:
context: .
dockerfile: .Dockerfile
networks:
- "training"
container_name: golang-training-web
command: "./myapp/start web"
ports:
- "80:1323"
depends_on:
- "migrate"
postgres:
image: 'postgres:10.7'
container_name: golang-training-db
networks:
- "training"
environment:
- POSTGRES_USER=test
- POSTGRES_PASSWORD=test
- POSTGRES_DB=payment
ports:
- 5432:5432
volumes:
- ./postgres-data:/var/lib/postgresql/data
migrate:
image: migrate/migrate
container_name: golang-training-migrate
networks:
- "training"
volumes:
- $PWD/migrations:/migrations
command: ["-path", "/migrations", "-database", "postgres://test:test@postgres:5432/payment?sslmode=disable", "up"]
depends_on:
- "postgres"
cron:
build:
context: .
dockerfile: .Dockerfile
networks:
- "training"
container_name: golang-training-cron
command: "/bin/sh /myapp/entrypoint.sh"
depends_on:
- "web"
localstack:
image: localstack/localstack
container_name: golang-training-localstack
networks:
- "training"
ports:
- 4566:4566
environment:
- SERVICES=sqs
- DOCKER_HOST=unix:///var/run/docker.sock
- DEFAULT_REGION=ap-southeast-2
healthcheck:
test:
- CMD
- bash
- -c
- awslocal sqs create-queue --queue-name=payment_queue && awslocal sqs list-queues
interval: 10s
timeout: 5s
retries: 5
volumes:
- "${TMPDIR:-/tmp/localstack}:/tmp/localstack"
- "/var/run/docker.sock:/var/run/docker.sock"
networks:
training:
driver: bridge