[Docker] postgres, pgadmin4 environment construction

Introduction

Note how to build postgres, pgadmin4 environment with docker

Environmental information

docker-compose.yml

version: '3'

services:
  pgadmin4:
    build: pgadmin4
    container_name: pgadmin4
    volumes:
      - pgadmin4_data:/var/lib/pgadmin
    environment:
      - PGADMIN_DEFAULT_EMAIL=[Initial login address]
      - PGADMIN_DEFAULT_PASSWORD=[Initial login password]
    ports:
      - "80:80"

  postgres:
    image: postgres:latest
    container_name: postgres
    volumes:
      - postgres_data:/var/lib/postgresql/data
    environment:
      - POSTGRES_USER=【user】
      - POSTGRES_PASSWORD=【password】
      - POSTGRES_INITDB_ARGS=--encoding=UTF-8 --locale=C
      - TZ=Asia/Tokyo
    ports:
      - 5432:5432

volumes:
  pgadmin4_data:
    external:
      name: pgadmin4_data
  postgres_data:
    external:
      name: postgres_data

Dockerfile

FROM dpage/pgadmin4

USER root

RUN apk update \
    && apk add --update --no-cache tzdata \
    && cp /usr/share/zoneinfo/Asia/Tokyo /etc/localtime \
    && echo "Asia/Tokyo" > /etc/timezone \
    && apk del tzdata

EXPOSE 80

Recommended Posts

[Docker] postgres, pgadmin4 environment construction
Docker environment construction
Rails Docker environment construction
MySQL 5.7 (Docker) environment construction memo
Redmine (Docker) environment construction memo
[Docker] Rails 5.2 environment construction with docker
Docker × Spring Boot environment construction
React environment construction with Docker
Rails + MySQL environment construction with Docker
Rails on Docker environment construction procedure
[Environment construction with Docker] Rails 6 & MySQL 8
SQL statement learning ~ Environment construction ~ Docker + MySQL
GPU environment construction with Docker [October 2020 version]
Rails environment construction with Docker (personal apocalypse)
Laravel development environment construction with Docker (Mac)
Sapper × Go (echo) × Docker development environment construction
[Java] Environment construction
Environment construction with Docker (Ubuntu20.04) + Laravel + nginx
Java environment construction
[Docker] Development environment construction Rails6 / Ruby2.7 / MySQL8
Spring Boot + Docker Java development environment construction
Laravel + MySQL + phpMyadmin environment construction with Docker
[Spring] Environment construction
Docker + DynamoDB local + C ++ environment construction and practice
Kaggle environment construction using official Docker and vscode
Rails6 [API mode] + MySQL5.7 environment construction with Docker
A reminder of Docker and development environment construction
IntelliJ + Docker (APP + DB) + SpringBoot (Maven) environment construction
React + Django + Nginx + MySQL environment construction with Docker
Wordpress local environment construction & development procedure with Docker
Penronse environment construction [Windows]
[Environment construction] Eclipse installation
[Flutter] Ubuntu 20.04 environment construction
Circle CI environment construction
java development environment construction
BEAR application Docker development environment construction example (docker-sync, Mutagen)
Database environment construction with Docker in Spring boot (IntellJ)
Construction of data analysis environment using Docker (personal memorandum)
Pytorch execution environment with Docker
Rails6 development environment construction [Mac]
[Spring Boot] Environment construction (macOS)
WSL2 + VSCode + Docker development environment
Rails engineer environment construction ruby2.7.1
EC-CUBE4 environment construction (local edition)
[Docker] Create Elasticsearch, Kibana environment!
I tried node-jt400 (Environment construction)
Rails environment construction Rails5.2.1 ruby2.5.1 Catalina
Introduction to Metabase ~ Environment Construction ~
Easy environment construction of MySQL and Redis with Docker and Alfred
[Portfolio] Manage site with laravel APP implementation (Docker environment construction)
AtCoder Challenge Environment Construction (Java 8)
Build docker environment with WSL
Rails application development environment construction with Docker [Docker, Rails, Puma, Nginx, MySQL]
How to build Rails, Postgres, ElasticSearch development environment with Docker
Offline environment construction Ruby edition
[Super easy] Ruby environment construction
[Rails / MySQL] Mac environment construction
Create Rails5 and postgresql environment with Docker and make pgadmin available
Laravel environment construction (Ubuntu 18.04 LTS)
Offline environment construction CentOS edition
Ruby on Rails development environment construction with Docker + VSCode (Remote Container)