Skip to content

Instantly share code, notes, and snippets.

@arthurd2
Last active July 5, 2024 21:22
Show Gist options
  • Select an option

  • Save arthurd2/737c85013ed6910f67cc35aad91d7eff to your computer and use it in GitHub Desktop.

Select an option

Save arthurd2/737c85013ed6910f67cc35aad91d7eff to your computer and use it in GitHub Desktop.
services:
db:
image: postgres:15
command: -c shared_buffers=16GB -c max_connections=200 -c work_mem=80MB
volumes:
- /dados:/var/lib/postgresql/data
- ./sql:/docker-entrypoint-initdb.d
environment:
- POSTGRES_DB=db
- POSTGRES_PASSWORD=dbpass
- POSTGRES_USER=dbuser
ports:
- "5432:5432"
restart: always
# Dentro do container, para criar outros usuarios e senhas
# psql -U dbuser
# CREATE DATABASE meu_db;
# CREATE USER meu_usuario WITH PASSWORD 'minha_senha';
# GRANT ALL PRIVILEGES ON DATABASE meu_db TO meu_usuario;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment