2024-02-12 13:12:06 +01:00
|
|
|
# Builds a release container
|
|
|
|
[private]
|
|
|
|
build-container-release:
|
2024-02-12 16:38:58 +01:00
|
|
|
podman build -t ttime-server -f container/Containerfile .
|
2024-02-12 13:12:06 +01:00
|
|
|
|
|
|
|
# Builds a release container and runs it
|
|
|
|
start-release: build-container-release remove-podman-containers
|
2024-02-12 16:38:58 +01:00
|
|
|
podman run -d -e DATABASE_URL=sqlite:release.db -p 8080:8080 --name ttime ttime-server
|
2024-02-12 18:56:49 +01:00
|
|
|
@echo "Started production ttime-server on http://localhost:8080"
|
2024-02-12 13:12:06 +01:00
|
|
|
|
|
|
|
# Removes and stops any containers related to the project
|
|
|
|
[private]
|
|
|
|
remove-podman-containers:
|
2024-02-12 16:38:58 +01:00
|
|
|
podman container rm -f ttime
|
2024-02-12 13:12:06 +01:00
|
|
|
|
2024-02-12 18:35:16 +01:00
|
|
|
# Saves the release container to a tarball, pigz is just gzip but multithreaded
|
|
|
|
save-release: build-container-release
|
2024-02-12 18:56:49 +01:00
|
|
|
podman save --format=oci-archive ttime-server | pigz -9 > ttime-server.tar.gz
|
2024-02-12 18:35:16 +01:00
|
|
|
|
|
|
|
# Loads the release container from a tarball
|
|
|
|
load-release file:
|
|
|
|
podman load --input {{file}}
|
|
|
|
|
2024-02-12 13:12:06 +01:00
|
|
|
# Cleans up everything related to the project
|
|
|
|
clean: remove-podman-containers
|
2024-02-12 16:38:58 +01:00
|
|
|
podman image rm -f ttime-server
|
2024-02-12 13:12:06 +01:00
|
|
|
rm -rf frontend/dist
|
|
|
|
rm -rf frontend/node_modules
|
2024-02-12 19:09:21 +01:00
|
|
|
rm -f ttime-server.tar.gz
|
2024-02-12 13:12:06 +01:00
|
|
|
cd backend && make clean
|
2024-02-20 14:10:07 +01:00
|
|
|
@echo "Cleaned up!"
|
|
|
|
|
|
|
|
# Cleans up everything related to podman, not just the project. Make sure you understand what this means.
|
|
|
|
[confirm]
|
|
|
|
podman-clean:
|
|
|
|
podman system reset --force
|