Merge branch '23-postgres' into develop
commit
5e28949b5c
6
Makefile
6
Makefile
|
@ -36,6 +36,7 @@ run:
|
||||||
# As a workaround, we just have a stop command that stops the container.
|
# As a workaround, we just have a stop command that stops the container.
|
||||||
stop:
|
stop:
|
||||||
@ docker stop -t 2 fej
|
@ docker stop -t 2 fej
|
||||||
|
@ docker stop fej_db
|
||||||
.PHONY: stop
|
.PHONY: stop
|
||||||
|
|
||||||
# This attaches to the running container, essentially giving the same result as
|
# This attaches to the running container, essentially giving the same result as
|
||||||
|
@ -44,6 +45,11 @@ logs:
|
||||||
@ docker logs -f fej
|
@ docker logs -f fej
|
||||||
.PHONY: logs
|
.PHONY: logs
|
||||||
|
|
||||||
|
# This just starts up a shell inside the fej container
|
||||||
|
sh:
|
||||||
|
@ docker exec -it fej sh
|
||||||
|
.PHONY: sh
|
||||||
|
|
||||||
# Builds the debug version, and runs the tests (but doesn't detach).
|
# Builds the debug version, and runs the tests (but doesn't detach).
|
||||||
test:
|
test:
|
||||||
@ ./build -m dev -a run -l -- test --no-fail-fast
|
@ ./build -m dev -a run -l -- test --no-fail-fast
|
||||||
|
|
16
build
16
build
|
@ -73,6 +73,20 @@ if [[ "$action" = push ]]; then
|
||||||
done
|
done
|
||||||
|
|
||||||
elif [[ "$action" = run ]]; then
|
elif [[ "$action" = run ]]; then
|
||||||
|
# Create the network & start the database container
|
||||||
|
docker network create fej
|
||||||
|
docker volume create fej_db-data
|
||||||
|
|
||||||
|
docker run --rm \
|
||||||
|
--detach \
|
||||||
|
--name fej_db \
|
||||||
|
--network fej \
|
||||||
|
-e "POSTGRES_DB=fej" \
|
||||||
|
-e "POSTGRES_USER=fej" \
|
||||||
|
-e "POSTGRES_PASSWORD=fej" \
|
||||||
|
-v 'fej_db-data:/var/lib/postgresql/data' \
|
||||||
|
postgres:13-alpine
|
||||||
|
|
||||||
if [[ "$mode" = "dev" ]]; then
|
if [[ "$mode" = "dev" ]]; then
|
||||||
# Create caching volumes if needed (they need to be named)
|
# Create caching volumes if needed (they need to be named)
|
||||||
docker volume create fej_build-cache
|
docker volume create fej_build-cache
|
||||||
|
@ -87,5 +101,7 @@ if [[ "$action" = push ]]; then
|
||||||
--tty \
|
--tty \
|
||||||
--publish 8000:8000 \
|
--publish 8000:8000 \
|
||||||
--name fej \
|
--name fej \
|
||||||
|
--env-file .env \
|
||||||
|
--network fej \
|
||||||
"$image$([[ "$mode" != "rel" ]] && echo "-dev"):$tags" "$@"
|
"$image$([[ "$mode" != "rel" ]] && echo "-dev"):$tags" "$@"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue