-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
61 lines (56 loc) · 1.71 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
version: '2'
services:
postgres:
image: postgres:latest
ports:
- "5432:5432"
networks:
- backtier
environment:
POSTGRES_USER: go
POSTGRES_PASSWORD: go
POSTGRES_DB: go
volumes:
- pgdata:/var/lib/postgresql/data
- .:/application/test2
go:
build: .
links:
- postgres:db # [other container]:[alias in this container]
# this will create environment variables in the go container
# with ip and port info for the postgres container
# also creates entries in /etc/hosts with ip info
# ports:
# - "8080" # this is port i'm exposing in the container
volumes:
- .:/go/src/test2
working_dir: /go/src/test2
command: go run server.go
networks:
- backtier
#command: go run server.go
proxy:
image: nginx:latest
ports:
- "80:80" # host:container
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
# connect host's ./nginx.conf with container's nginx.conf
# :ro == read only perms in container
links:
- go:app # [other container]:[alias in this container]
# creates environment variables in proxy container
# with ip and port info for go container
# also creates entries in /etc/hosts with ip info
networks:
- backtier
volumes:
pgdata: {}
networks:
backtier:
driver: bridge
ipam:
config:
- subnet: 172.15.0.0/16
gateway: 172.15.0.1