version: '3' services: accountapi: image: form3tech/interview-accountapi:v1.0.0-50-ga251d4fc restart: on-failure depends_on: - postgresql - vault environment: - VAULT_ADDR=http://vault:8200 - VAULT_TOKEN=8fb95528-57c6-422e-9722-d2147bcba8ed - PSQL_USER=root - PSQL_PASSWORD=password - PSQL_HOST=postgresql - PSQL_PORT=5432 - STACK_NAME=f3-interview-accountapi - DATABASE-HOST=postgresql - DATABASE-SSL-MODE=disable - DATABASE-USERNAME=interview_accountapi_user - DATABASE-PASSWORD=123 ports: - 8080:8080 logging: driver: none postgresql: # Could use a Postgres EDD tool I created to seperate the db creation into it's own layer # https://github.com/LaurentGoderre/pg-evolve image: postgres:9.5-alpine healthcheck: test: [ "CMD", "pg_isready", "-q", "-d", "postgres", "-U", "root" ] timeout: 45s interval: 10s retries: 10 restart: always environment: - POSTGRES_USER=root - POSTGRES_PASSWORD=password volumes: - ./scripts/db:/docker-entrypoint-initdb.d/ logging: driver: none vault: image: vault:1.6.3 environment: - SKIP_SETCAP=1 - VAULT_DEV_ROOT_TOKEN_ID=8fb95528-57c6-422e-9722-d2147bcba8ed logging: driver: none main: image: form3-accountapi build: . depends_on: - accountapi entrypoint: /entrypoint.sh environment: - API_HOST=http://accountapi:8080 test: image: form3-accountapi depends_on: - main environment: - CGO_ENABLED=0 working_dir: /usr/local/go/src/form3/account/client command: ["go", "test"]