Skip to content

Instantly share code, notes, and snippets.

@Edclydson
Last active March 23, 2023 21:51
Show Gist options
  • Save Edclydson/f37d1434825235432bb5d8a2af009c2c to your computer and use it in GitHub Desktop.
Save Edclydson/f37d1434825235432bb5d8a2af009c2c to your computer and use it in GitHub Desktop.
configuração do docker-compose
# versão
version: '3.8'
# setando serviços utilizados (Apache e Postgres)
services:
server: # serviço do tipo server
image: httpd:latest # referencia da imagem
container_name: Apache-GRS # nome do container
restart: always
ports:
- 80:80 # mapeando portas externa:interna do container
volumes:
- ./data/www:/usr/local/apache2/htdocs/
depends_on:
- db
db : # serviço do tipo db
image: postgres:latest
container_name: PostgreSQL-GRS
restart: always
environment: # variaveis de ambiente
POSTGRES_USER: postgres # superuser
POSTGRES_PASSWORD: admin123 # senha
POSTGRES_DB: grs_db # banco de dados
volumes: # volume onde está a base de dados
- ./data/db:/var/lib/postgresql/data
ports:
- 5432:5432
volumes:
postgres-data:
driver: bridge # driver para conexão com o container (bridge) e não com o server local do postgres (local)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment