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

32 lines
678 B
YAML
Raw Normal View History

2020-09-11 12:09:53 +00:00
version: "3"
services:
db:
image: postgres
2020-09-11 09:13:09 +00:00
env_file: ./configs/db.env
volumes:
2020-09-11 12:09:53 +00:00
- db_postgres:/var/lib/postgresql/data
2020-09-11 09:13:09 +00:00
- ./scripts/db/ddl_01.sql:/docker-entrypoint-initdb.d/10_schema.sql
- ./scripts/db/dml_01.sql:/docker-entrypoint-initdb.d/20_insert.sql
2020-09-10 12:27:23 +00:00
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-11 09:13:09 +00:00
env_file: ./configs/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