Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- version: '2'
- services:
- db:
- image: postgres
- ports:
- - 5432:5432
- environment:
- - POSTGRES_USER=postgres
- - POSTGRES_PASSWORD=postgres
- # You definitly need some tools to visualize/edit/debug your database right?
- yourprojectname-pgadmin:
- image: dpage/pgadmin4
- ports:
- - 8888:80
- environment:
- - PGADMIN_DEFAULT_EMAIL=user@domain.com
- - PGADMIN_DEFAULT_PASSWORD=SuperSecret
- links:
- # SERVICE:ALIAS
- # Link your db service to database domain, so that in pgadmin you can use postgres://database:5432... to access your db
- - "db:database"
- # your go enviroment
- workspace:
- image: golang:1.10
- # why we need a container_name here? just easy for you to attach
- container_name: workspace
- ports:
- - 8080:80
- volumes:
- # attach folder of your project in local filesystem to this container
- - ".:{your path}"
- environment:
- - PGURL=postgres://postgres:postgres@database:5432/postgres?sslmode=disable
- - PORT=80
- # change the path to your project root here so that once you attach this container, you will be in the project root
- command: bash -c "cd /go/src/... && bash"
- stdin_open: true
- tty: true
- links:
- # so that this container can access your database service using postgres://database...
- - "db:database"
Add Comment
Please, Sign In to add comment