Add docker-compose support

This commit is contained in:
2018-05-17 21:29:16 +10:00
parent dd8d676df4
commit bf196126ef
3 changed files with 36 additions and 0 deletions
+2
View File
@@ -0,0 +1,2 @@
FROM alpine:3
+8
View File
@@ -0,0 +1,8 @@
# Shopping
## Run
```bash
docker-compose up
```
+26
View File
@@ -0,0 +1,26 @@
version: "3.2"
services:
db:
image: postgres:9.6
environment:
POSTGRES_PASSWORD: shopping
POSTGRES_DB: shopping
ports:
- 5432:5432
app:
image: golang
depends_on:
- db
volumes:
- .:/go/src/toozhao.com/shopping
working_dir: /go/src/toozhao.com/shopping
command: ["go", "run", "main.go"]
ports:
- 8080:8080
environment:
DB_HOST: db
DB_USER: postgres
DB_PASSWORD: shopping
DB_DATABASE: shopping