build(docker): replace docker compose with podman and link Dockerfiles to root dir instead

This commit is contained in:
Sarah Vaupel 2024-09-05 12:23:04 +02:00
parent a96dc946a8
commit c10715fdfc
3 changed files with 9 additions and 8 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
.Dockerfile
dist*
node_modules/
assets/icons

View File

@ -2,7 +2,7 @@
db ?= -cf
CONTAINER_RUNNER ?= docker compose
CONTAINER_RUNNER ?= podman
.PHONY: help
help:
@ -122,7 +122,8 @@ frontend-%: node_modules well-known --frontend-%;
.PHONY: --frontend-test
--frontend-test: karma.conf.cjs
npx -- karma start --conf karma.conf.cjs $(WATCH)
@echo Karma frontend tests are currently work in progress and have been temporarily disabled.
# npx -- karma start --conf karma.conf.cjs $(WATCH)
.PHONY: --frontend-test-watch
--frontend-test-watch: WATCH=--single-run false
@ -180,6 +181,8 @@ well-known/.well-known:
# run-s frontend:build --parallel "frontend:build:watch" "yesod:start"
--docker-build-%:
$(CONTAINER_RUNNER) build $(FRADRIVE_SERVICE)
rm -f .Dockerfile
ln -s docker/$(FRADRIVE_SERVICE)/Dockerfile .Dockerfile
$(CONTAINER_RUNNER) build -v $(PWD):/tmp/fradrive --tag $(FRADRIVE_SERVICE) --file $(PWD)/.Dockerfile
--docker-run-%:
$(CONTAINER_RUNNER) run -u `id -u`:`id -g` --env FRADRIVE_MAKE_TARGET=$* $(FRADRIVE_SERVICE)
$(CONTAINER_RUNNER) run -v $(PWD):/tmp/fradrive --env FRADRIVE_MAKE_TARGET=$* $(FRADRIVE_SERVICE)

View File

@ -1,4 +1,3 @@
# TODO: switch to uniworx registry debian image
FROM registry.uniworx.de/uniworx/containers/debian:12.5
# Basic dependencies
@ -17,9 +16,7 @@ RUN n 20.17.0
ARG PROJECT_DIR=/fradrive
RUN mkdir -p ${PROJECT_DIR}
RUN --mount=type=bind,source=.,target=/tmp${PROJECT_DIR} \
cp -r /tmp${PROJECT_DIR}/* ${PROJECT_DIR}
RUN chmod -R 777 ${PROJECT_DIR}
RUN cp -r /tmp${PROJECT_DIR}/* ${PROJECT_DIR}
WORKDIR ${PROJECT_DIR}
ENV HOME=${PROJECT_DIR}