mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-02 20:15:22 +02:00
Back in this [commit](5f50ea3f02 (diff-5a674c769541a71f2471a45c0e9dde911b4455344e3131bddc5a363701ba6325R22-R23)
) I added a default postgres user and password.
Often this is not the user and password that is used in non-devcontainer environments.
This commit uses environment variables that are set in the devcontainer to set the user and password in the database.yml file.
If the environment variables are not set, it falls back to the default user and password on the users system.
47 lines
770 B
YAML
47 lines
770 B
YAML
version: "3"
|
|
|
|
services:
|
|
app:
|
|
build:
|
|
context: ..
|
|
dockerfile: .devcontainer/Dockerfile
|
|
|
|
volumes:
|
|
- ..:/workspace:cached
|
|
- bundle_cache:/bundle
|
|
|
|
ports:
|
|
- "3000:3000"
|
|
|
|
command: sleep infinity
|
|
|
|
environment:
|
|
DB_HOST: db
|
|
HOST: "0.0.0.0"
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: postgres
|
|
|
|
depends_on:
|
|
- db
|
|
- redis
|
|
|
|
redis:
|
|
image: redis:latest
|
|
ports:
|
|
- "6379:6379"
|
|
|
|
db:
|
|
image: postgres:latest
|
|
restart: unless-stopped
|
|
volumes:
|
|
- postgres-data:/var/lib/postgresql/data
|
|
environment:
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_DB: postgres
|
|
POSTGRES_PASSWORD: postgres
|
|
ports:
|
|
- "5432:5432"
|
|
|
|
volumes:
|
|
postgres-data:
|
|
bundle_cache:
|