postgresql dockerfile example
Example 1: 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
Example 2: docker postgres
$ docker run
Example 3: docker create postgres db
COPY your_sql_file.sql /docker-entrypoint-initdb.d/
Example 4: dockerfile example
FROM ubuntu:18.04
COPY . /app
RUN make /app
CMD python /app/app.py