Last active
July 5, 2024 21:22
-
-
Save arthurd2/737c85013ed6910f67cc35aad91d7eff to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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