[closes #33] Added compose file; ./fejctl rr works now

master^2
Jef Roosens 2021-04-17 15:10:42 +02:00
parent 65c3d616de
commit 00bf8501dd
Signed by: Jef Roosens
GPG Key ID: B580B976584B5F30
3 changed files with 52 additions and 2 deletions

View File

@ -7,5 +7,8 @@ write_timeout = 5
log = "normal"
limits = { forms = 32768 }
[global.databases]
[development.databases]
postgres_fej = { url = "postgres://fej:fej@fej_db:5432/fej" }
[production.databases]
postgres_fej = { url = "postgres://fej:fej@db:5432/fej" }

View File

@ -0,0 +1,35 @@
version: '2.4'
services:
app:
image: 'chewingbever/fej:latest'
restart: 'always'
depends_on:
db:
condition: 'service_healthy'
environment:
- 'DATABASE_URL=postgres://fej:fej@db:5432/fej'
db:
image: 'postgres:13-alpine'
restart: 'always'
environment:
- 'POSTGRES_DB=fej'
- 'POSTGRES_USER=fej'
- 'POSTGRES_PASSWORD=fej'
healthcheck:
test: 'pg_isready -U fej'
interval: '30s'
timeout: '5s'
retries: 3
start_period: '0s'
volumes:
- 'db-data:/var/lib/postgresql/data'
volumes:
db-data:

14
fejctl
View File

@ -105,7 +105,18 @@ function stop() {
}
function run_release() {
echo "Not implemented"
docker-compose \
--file docker/docker-compose.yml \
--project-name fej-release \
up \
--detach
}
function stop_release() {
docker-compose \
--file docker/docker-compose.yml \
--project-name fej-release \
down
}
# Tags & pushes the release version to Docker Hub
@ -155,6 +166,7 @@ function main() {
r | run ) run "$bin" ;;
rr | run-release ) run_release ;;
s | stop ) stop ;;
sr | stop-release ) stop_release ;;
# Ease of life
psql ) docker exec -it fej_db psql -U fej -d fej ;;