-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.test.yml
45 lines (45 loc) · 1.17 KB
/
docker-compose.test.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
version: '3'
networks:
whoisbi-test:
driver: bridge
services:
postgres:
container_name: postgres-test
image: postgres
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
networks:
- whoisbi-test
restart: on-failure
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
test:
build:
context: .
dockerfile: dev/test.dockerfile
command: ["bash", "-c", "until nc postgres 5432; do sleep 2; done ; toolbox schema && go test -failfast ./..."]
networks:
- whoisbi-test
depends_on:
- postgres
environment:
POSTGRES_URI: ${POSTGRES_URI}
HTTP_API_ADDR: ${HTTP_API_ADDR}
HTTP_SESSION_ID: ${HTTP_SESSION_ID}
HTTP_COOKIE_SECRET: ${HTTP_COOKIE_SECRET}
SMTP_FROM_NAME: ${SMTP_FROM_NAME}
SMTP_EMAIL: ${SMTP_EMAIL}
SMTP_PASSWORD: ${SMTP_PASSWORD}
SMTP_HOST: ${SMTP_HOST}
SMTP_PORT: ${SMTP_PORT}
RABBITMQ_URI: ${RABBITMQ_URI}
MODE: ${MODE}
CGO_ENABLED: 0
volumes:
- .:/build