Answer the question
In order to leave comments, you need to log in
Docker, postgres and database creation?
When I run the image creation from the terminal with the command
docker run --name proj_bd -d \
--env 'DB_NAME=main_base' \
--env 'DB_USER=user' --env 'DB_PASS=pass' \
--env 'DB_EXTENSION=pg_trgm' \
postgresql:11.1
version: "3.7"
services:
postgresql:
image: postgres:11.1
env_file: vars.sh
volumes:
- ./dockerfiles/pgdata:/var/lib/postgresql/data/pgdata
ports:
- "5433:5432"
DB_NAME=main_base
DB_USER=user
DB_PASS=pass
DB_HOST=postgresql
Answer the question
In order to leave comments, you need to log in
The database and the user are created by running with the variables from the description https://hub.docker.com/_/postgres
version: '3.3'
services:
pgsql:
image: postgres:11.1
ports:
- 5432:5432
volumes:
- ./pgsql:/var/lib/postgresql/data
environment:
POSTGRES_PASSWORD: app
POSTGRES_USER: app
POSTGRES_DB: app
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question