-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
72 lines (63 loc) · 1.83 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
62
63
64
65
66
67
68
69
70
71
72
version: '3.8'
services:
pg:
image: postgres:${PG_VERSION:- 9.6-alpine}
environment:
- POSTGRES_URL
volumes: # create a bind mount to pass file that executes tablea creation by SQL
- ./sql/create_table.sql:/docker-entrypoint-initdb.d/create_table.sql
- pgdata:/var/lib/postgresql/data
- .psqlrc:/root/.psqlrc:ro
- ./log:/root/log:cached
ports:
- 5432
webapp:
image: ndrean/webapp:latest
build:
context: .
dockerfile: Dockerfile
args:
CACHE_IMAGE: ndrean/webapp:gem-cache
# tmpfs:
# - /tmp # ?? ot volumes: - type:tmpfs - src,-dst...??
volumes: # to mount bind the code (and get the db logs)
- .:/usr/app:cached
# - bundle:/usr/local/bundle:ro
# below test by monting docker socket of the host to get # count containers
# - /var/run/docker.sock:/var/run/docker.sock
# ports: # removed to be able to run multiple instances of the app: nginx L.B.
# - 9292:9292
depends_on:
- pg
environment:
- POSTGRES_URL
# - PIDFILE
webserver:
image: ndrean/webserver:latest
build: # when the context is provided, we build the image
context: ./webserver
dockerfile: Dockerfile
depends_on:
- webapp
volumes: # to mount bind the static files for Nginx to serve instead of Puma
- ./public:/usr/share/nginx/html:ro
# - ./tmp/cache:/var/cache/nginx/mycache
environment:
- PROXY_UPSTREAM
ports:
- 8080:8080
# command: nginx -g 'daemon off;' # override the one in Dockerfile
# entrypoint:
# client:
# image:
# build:
# context: ./client
# dockerfile: Dockerfile
# environment:
# - POSTGRES_DB
# - POSTGRES_PASSWORD
# - POSTGRES_USER
# - POSTGRES_HOST
volumes:
pgdata:
bundle: