POC-golang-postgres-docker/docker-compose.yml

34 lines
658 B
YAML
Raw Normal View History

version: '3'
services:
db:
image: postgres
2020-09-10 12:27:23 +00:00
env_file:
- ./db.env
volumes:
2020-09-10 12:27:23 +00:00
- ./db_postgres:/var/lib/postgresql/data
- ./ddl_01.sql:/docker-entrypoint-initdb.d/10_schema.sql
- ./dml_01.sql:/docker-entrypoint-initdb.d/20_insert.sql
expose:
- "5432"
restart: always
networks:
- genity_network
2020-09-10 12:27:23 +00:00
web:
build: ""
command: [ "go", "run", "main.go","api.go"]
2020-09-10 12:27:23 +00:00
env_file:
- ./web.env
ports:
2020-09-10 12:27:23 +00:00
- "5000:5000"
restart: always
depends_on:
- db
links:
- db
networks:
- genity_network
volumes:
db_postgres:
networks:
genity_network:
driver: bridge