ex_trainer/docker-compose.yml
João Paulo Dubas e7df0322d7
All checks were successful
continuous-integration/drone/push Build is passing
Improve project usage (#6)
1. Ignore unnecessary files, such as `pgcli` log/history, and extra `docker-compose` definitions.
2. Add `Makefile` with common tasks.
3. Add git pre-commit hook to ensure project is always properly formatted.
4. Add [`btree_gist`][0] extension to `postgres`.

Reviewed-on: #6

[0]: https://www.postgresql.org/docs/14/btree-gist.html
2022-04-23 17:15:16 +00:00

55 lines
1.2 KiB
YAML

---
version: '3.7'
services:
db:
image: 'postgres:14.2-alpine'
hostname: &db_host db
init: true
environment:
POSTGRES_USER: &db_user postgres
POSTGRES_PASSWORD: &db_pass postgres
POSTGRES_DB: &db_name postgres
volumes:
- './priv/docker/postgres/init.sql:/docker-entrypoint-initdb.d/init.sql'
- 'db_data:/var/lib/postgresql/data'
restart: unless-stopped
app:
image: 'elixir:1.13.4'
hostname: app
depends_on:
- db
init: true
environment:
POSTGRES_HOST: *db_host
POSTGRES_USER: *db_user
POSTGRES_PASS: *db_pass
POSTGRES_NAME: wabanex_dev
volumes:
- '.:/opt/app'
- 'app_build:/opt/app/_build'
- 'app_deps:/opt/app/deps'
working_dir: /opt/app
entrypoint: sleep
command: infinity
pgcli:
image: 'joaodubas/pgcli:latest'
hostname: development
depends_on:
- db
environment:
PGUSER: *db_user
PGPASSWORD: *db_pass
PGHOST: *db_host
PGDATABASE: wabanex_dev
volumes:
- './priv/docker/pgcli:/root/.config/pgcli'
restart: unless-stopped
entrypoint: sleep
command: 3650d
volumes:
db_data: {}
app_build: {}
app_deps: {}