#-------------------------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
#-------------------------------------------------------------------------------------------------------------

version: '3'
services:
  web:
    # Uncomment the next line to use a non-root user for all processes. You can also
    # simply use the "remoteUser" property in devcontainer.json if you just want VS Code
    # and its sub-processes (terminals, tasks, debugging) to execute as the user. On Linux,
    # you may need to update USER_UID and USER_GID in .devcontainer/Dockerfile to match your
    # user if not 1000. See https://aka.ms/vscode-remote/containers/non-root for details.
    # user: node

    build: 
      context: .
      dockerfile: Dockerfile
    
    volumes:
      - ..:/workspace:cached

    environment:
      PGPASSWORD: pass
      PGUSER: user
      PGDATABASE: data
      PGHOST: db
      # set this to true in the development environment until I can get SSL setup on the 
      # docker postgres instance
      PGTESTNOSSL: 'true'
      
    # Overrides default command so things don't shut down after the process ends.
    command: sleep infinity

    links:
      - db

  db:
    image: postgres
    restart: unless-stopped
    ports: 
      - 5432:5432
    environment:
      POSTGRES_PASSWORD: pass
      POSTGRES_USER: user
      POSTGRES_DB: data
 
