chore: simplify and use docker for production testing

This commit is contained in:
js0ny 2025-10-19 02:57:26 +01:00
parent 6d14e5c2aa
commit 11160b879f
3 changed files with 53 additions and 24 deletions

View file

@ -20,32 +20,32 @@ build:
.PHONY: docker-build
docker-build: build
podman build -t ${FULL_IMAGE_NAME} .
docker build -t ${FULL_IMAGE_NAME} .
# Run the container in detached mode.
# It will first stop and remove any existing container with the same name.
.PHONY: run
run: docker-build
@echo "Stopping and removing old container if it exists..."
# -podman stop ${CONTAINER_NAME} > /dev/null 2>&1 || true
# -podman rm ${CONTAINER_NAME} > /dev/null 2>&1 || true
podman-compose stop
# -docker stop ${CONTAINER_NAME} > /dev/null 2>&1 || true
# -docker rm ${CONTAINER_NAME} > /dev/null 2>&1 || true
docker-compose stop
@echo "Starting new container '${CONTAINER_NAME}' on http://localhost:8080"
podman-compose up -d
docker-compose up -d
.PHONY: stop
stop:
@echo "Stopping and removing container: ${CONTAINER_NAME}"
# -podman stop ${CONTAINER_NAME} > /dev/null 2>&1 || true
# -podman rm ${CONTAINER_NAME} > /dev/null 2>&1 || true
podman-compose stop > /dev/null 2>&1 || true
# -docker stop ${CONTAINER_NAME} > /dev/null 2>&1 || true
# -docker rm ${CONTAINER_NAME} > /dev/null 2>&1 || true
docker-compose stop > /dev/null 2>&1 || true
# --- Submission Target ---
.PHONY: save
save: docker-build
podman save -o ${SUBMISSION_FILE} ${FULL_IMAGE_NAME}
docker save -o ${SUBMISSION_FILE} ${FULL_IMAGE_NAME}
@echo "Submission file '${SUBMISSION_FILE}' created successfully."