Rovatiana/LearnPulse
1
1version: '3'2 3services:4 app:5 build:6 context: ..7 dockerfile: .devcontainer/Dockerfile8 args:9 # Update 'VARIANT' to pick a version of Ruby: 3, 3.0, 2, 2.7, 2.610 # Append -bullseye or -buster to pin to an OS version.11 # Use -bullseye variants on local arm64/Apple Silicon.12 VARIANT: "2.7"13 # Optional Node.js version to install14 NODE_VERSION: "lts/*"15 16 volumes:17 - ..:/workspace:cached18 19 # Overrides default command so things don't shut down after the process ends.20 command: sleep infinity21 22 # Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function.23 network_mode: service:db24 # Uncomment the next line to use a non-root user for all processes.25 # user: vscode26 27 # Use "forwardPorts" in **devcontainer.json** to forward an app port locally.28 # (Adding the "ports" property to this file will not forward from a Codespace.)29 30 db:31 image: postgres:latest32 restart: unless-stopped33 volumes:34 - postgres-data:/var/lib/postgresql/data35 - ./create-db-user.sql:/docker-entrypoint-initdb.d/create-db-user.sql36 environment:37 POSTGRES_USER: postgres_username38 POSTGRES_DB: postgres39 POSTGRES_PASSWORD: postgres_password40 # Add "forwardPorts": ["5432"] to **devcontainer.json** to forward PostgreSQL locally.41 # (Adding the "ports" property to this file will not forward from a Codespace.)42 43volumes:44 postgres-data: null45 