fix(ci): start docker

fastapi-admin
Pierre-Louis Guhur 1 year ago
parent 0356e242bd
commit 5ece8dde78

@ -5,6 +5,10 @@ services:
image: postgres:15.1
restart: unless-stopped
hostname: mj_db
healthcheck:
start_period: 10s
test: ["CMD", "pg_isready", "-U", "postgres"]
interval: 30s
environment:
- POSTGRES_USER=${DB_USER:-mj}
- POSTGRES_PASSWORD=$DB_PASS
@ -27,8 +31,10 @@ services:
start_period: 30s
test: ['CMD-SHELL', 'curl localhost:8877/liveness -s -f -o /dev/null || exit 1']
interval: 30s
retries: 5
depends_on:
- mj_db
- mj_db:
condition: service_healthy
volumes:
- .:/code
networks:

@ -0,0 +1,7 @@
tmpfile=$(mktemp /tmp/mj-api.XXXX)
echo "SECRET=mysecrettoken" >> $tmpfile
echo "SQLITE=True" >> $tmpfile
docker run --env-file $tmpfile \
majority-judgment/api-python:latest \
-c "pip install -r requirements-dev.txt; pytest"

@ -1,7 +1,5 @@
tmpfile=$(mktemp /tmp/mj-api.XXXX)
echo "SECRET=mysecrettoken" >> $tmpfile
echo "SQLITE=True" >> $tmpfile
#! /usr/bin/env bash
# This script allows to start the backend with all services
docker compose --profile all --env-file .env.local up -d --build
docker run --env-file $tmpfile \
majority-judgment/api-python:latest \
-c "pip install -r requirements-dev.txt; pytest"

Loading…
Cancel
Save