Friday, May 7, 2021

Postgres & Adminer on Docker

Postgres & Adminer on Docker stack.

version: '3'

services:

  postgres:
    image: postgres:13.2-alpine
    restart: always
    environment:
      POSTGRES_PASSWORD: secret
      POSTGRES_USER: pguser
      POSTGRES_DB: pgdb
    ports:
      - "5432:5432"
    volumes:
      - pg-data:/var/lib/postgresql/data
    networks:
      - pg-network
 

  adminer:
    image: adminer:4.8.0-standalone
    restart: always
    ports:
      - "8080:8080"
    networks:
      - pg-network

networks:
  pg-network:
    driver: bridge

volumes:
  pg-data:
    driver: local
This will set up the two services on the same network and assign a volume for the database.

No comments:

Post a Comment