-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
30 lines (29 loc) · 1.03 KB
/
docker-compose.yaml
File metadata and controls
30 lines (29 loc) · 1.03 KB
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
services:
shiny:
build:
context: .
dockerfile: DOCKERFILE
container_name: fe_shiny
restart: always
ports:
- "3838:3838"
volumes:
- "./shiny-data:/srv/shiny-server/survey"
command: ["R", "--vanilla", "-e", "shiny::runApp('/srv/shiny-server/survey', host='0.0.0.0', port=3838)"]
postgres:
# a name, e.g., db_container is instrumental to be
# called as host from the shiny app
container_name: db_container
image: postgres:15-alpine
restart: always
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres # Don't use passwords like this in production
# This port mapping is only necessary to connect from the host,
# not to let containers talk to each other.
# port-forwarding: from host port:to docker port -> mapping
ports:
- "1111:5432"
# if container killed, then data is still stored in volume (locally)
volumes:
- "./pgdata:/var/lib/postgresql/data"