github.com/popeskul/qna-go@v0.0.0-20230109215716-6e2a125005c8/docker-compose.yml (about) 1 version: "3.9" 2 3 services: 4 postgres: 5 image: postgres:latest 6 container_name: "database" 7 restart: unless-stopped 8 ports: 9 - "5432:5432" 10 environment: 11 POSTGRES_DB: postgres 12 POSTGRES_USER: postgres 13 POSTGRES_PASSWORD: 12345 14 networks: 15 - fullstack 16 volumes: 17 - database_postgres:/var/lib/postgresql/data 18 19 web: 20 build: 21 context: . 22 dockerfile: Dockerfile 23 container_name: "web-api" 24 environment: 25 DB_HOST: localhost 26 DB_PORT: 5432 27 DB_USER: postgres 28 DB_PASSWORD: 12345 29 DB_NAME: postgres 30 DB_SSLMODE: disable 31 ports: 32 - "8080:8080" 33 depends_on: 34 - postgres 35 restart: always 36 env_file: 37 - .env 38 networks: 39 - fullstack 40 41 volumes: 42 database_postgres: 43 44 networks: 45 fullstack: 46 driver: bridge