Skip to content

Instantly share code, notes, and snippets.

@francoisruty
Created July 31, 2019 13:46
Show Gist options
  • Select an option

  • Save francoisruty/5c9794abcdfa5d88ccdde95b57575c11 to your computer and use it in GitHub Desktop.

Select an option

Save francoisruty/5c9794abcdfa5d88ccdde95b57575c11 to your computer and use it in GitHub Desktop.

Revisions

  1. francoisruty created this gist Jul 31, 2019.
    60 changes: 60 additions & 0 deletions docker-compose.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,60 @@
    version: '2'
    services:

    nginx-front:
    image: nginx:stable
    ports:
    - "3000:80"
    volumes:
    - ./nginx-front.conf:/etc/nginx/nginx.conf
    links:
    - front
    - back

    front:
    image: node:8.7-alpine
    command: ["/bin/sh", "-c","cd /home/app && npm run dev"]
    ports:
    - "3001:3000"
    environment:
    REACT_EDITOR: atom
    volumes:
    - ./front:/home/app

    back:
    image: node:8.7-alpine
    command: ["/bin/sh", "-c","cd /home/app && npm run dev"]
    volumes:
    - ./back:/home/app
    environment:
    PGUSER: ${PG_USER}
    PGPASSWORD: ${PG_PASSWORD}
    PGDATABASE: ${PG_DATABASE}
    PGHOST: postgres
    links:
    - postgres


    postgres:
    image: postgres:9.6
    environment:
    POSTGRES_DB: ${PG_DATABASE}
    POSTGRES_USER: ${PG_USER}
    POSTGRES_PASSWORD: ${PG_PASSWORD}
    volumes:
    - data:/var/lib/postgresql/data
    - ./db:/init

    pgweb:
    image: sosedoff/pgweb
    command: pgweb --readonly --bind=0.0.0.0 --listen=8081
    ports: ["5000:8081"]
    links:
    - postgres:postgres
    environment:
    - DATABASE_URL=postgres://${PG_USER}:${PG_PASSWORD}@postgres:5432/${PG_DATABASE}?sslmode=disable
    depends_on:
    - postgres

    volumes:
    data: {}