46 lines
1.2 KiB
YAML
46 lines
1.2 KiB
YAML
version: '3'
|
|
|
|
services:
|
|
app:
|
|
build:
|
|
context: ..
|
|
dockerfile: .devcontainer/Dockerfile.devcontainer
|
|
|
|
volumes:
|
|
- ../..:/workspaces:cached
|
|
- devcontainer-redux-gem-cache:/usr/local/rvm/gems
|
|
|
|
# Overrides default command so things don't shut down after the process ends.
|
|
command: sleep infinity
|
|
|
|
# Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function.
|
|
network_mode: service:db
|
|
|
|
db:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile.postgres
|
|
restart: unless-stopped
|
|
volumes:
|
|
- postgres-data:/var/lib/postgresql/data
|
|
- ./create-db-user.sql:/docker-entrypoint-initdb.d/create-db-user.sql
|
|
environment:
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_DB: postgres
|
|
POSTGRES_PASSWORD: postgres
|
|
|
|
pgadmin:
|
|
image: dpage/pgadmin4:8.13.0
|
|
restart: unless-stopped
|
|
network_mode: service:db
|
|
environment:
|
|
PGADMIN_DEFAULT_EMAIL: admin@example.com
|
|
PGADMIN_DEFAULT_PASSWORD: password
|
|
PGADMIN_LISTEN_PORT: 8080
|
|
PGADMIN_CONFIG_SERVER_MODE: False
|
|
PGADMIN_CONFIG_MASTER_PASSWORD_REQUIRED: False
|
|
|
|
volumes:
|
|
postgres-data:
|
|
devcontainer-redux-gem-cache:
|