Answers for "docker run postgres"

9

postgres docker compose

version: '3'
services:
  postgres-service:
    image: postgres:latest
    container_name: postgres-container
    ports:
      - 55432:5432/tcp
    environment:
      POSTGRES_DB: pg_db
      POSTGRES_PASSWORD: appdbpassword
    volumes:
      - /var/lib/postgres
      - ./dbscripts/postgres:/docker-entrypoint-initdb.d
Posted by: Guest on August-05-2020
9

docker postgres

$ docker run --name some-postgres -e POSTGRES_PASSWORD=mysecretpassword -p 5432:5432 -d postgres
Posted by: Guest on September-17-2020
2

docker run postgres locally

$ docker run -d --name my_postgres -v my_dbdata:/var/lib/postgresql/data -p 54320:5432 postgres:11
Posted by: Guest on March-18-2020
1

docker create postgres db

# inside Dockerfile
COPY your_sql_file.sql /docker-entrypoint-initdb.d/
Posted by: Guest on January-04-2021

Browse Popular Code Answers by Language