Integrate the demo_web_app

Changes to the examples

Images

The files

  • db.env
    POSTGRES_DB=web_app_db
    POSTGRES_USER=app
    POSTGRES_PASSWORD=secret
    
  • docker-compose.yml
    version: '3.3'
    
    services:
      web:
        image: nginx:latest
        ports:
          - 80:80
        volumes:
          - ./html:/usr/share/nginx/html
    
      pg:
        image: postgres:9.6-alpine
        env_file:
          - ./db.env
        volumes:
          - pg-data:/var/lib/postgresql/data
    
      alpine:
        image: alpine:latest
        stdin_open: true
        tty: true
        command: sh
    
    volumes:
      pg-data:
    

Interacting with containers

Managing environment variables