diff --git a/Dockerfile b/Dockerfile index 5222643..378861b 100755 --- a/Dockerfile +++ b/Dockerfile @@ -11,13 +11,15 @@ ARG ENVIRONMENT=prod RUN printf '#!/bin/sh\n%s\nexec "$@"' "$(pixi shell-hook -e ${ENVIRONMENT})" > /entrypoint.sh RUN chmod +x /entrypoint.sh +FROM build as prod-build + # must be the last command of this stage, or else pixi will overwrite the installed package. RUN pixi run postinstall-production FROM docker.io/library/debian:bookworm-slim -COPY --from=build /app/.pixi/envs/${ENVIRONMENT} /app/.pixi/envs/${ENVIRONMENT} -COPY --from=build /entrypoint.sh /entrypoint.sh +COPY --from=prod-build /app/.pixi/envs/${ENVIRONMENT} /app/.pixi/envs/${ENVIRONMENT} +COPY --from=prod-build /entrypoint.sh /entrypoint.sh ENTRYPOINT [ "/entrypoint.sh" ] CMD ["gunicorn", "--bind", "0.0.0.0:5005", "--workers", "8", "--timeout", "3600", "pfcon.wsgi:application"] diff --git a/make.sh b/make.sh index 1db54ec..fc41a39 100755 --- a/make.sh +++ b/make.sh @@ -307,18 +307,18 @@ if (( ! b_skipUnitTests )) ; then if [[ $ORCHESTRATOR == swarm ]]; then if (( b_pfconInNetwork )) ; then if [[ $STORAGE == 'swift' ]]; then - docker exec $pfcon_dev pytest tests/test_resources_innetwork.py --color=yes + docker exec $pfcon_dev pixi run pytest tests/test_resources_innetwork.py --color=yes elif [[ $STORAGE == 'filesystem' ]]; then - docker exec $pfcon_dev pytest tests/test_resources_innetwork_fs.py --color=yes + docker exec $pfcon_dev pixi run pytest tests/test_resources_innetwork_fs.py --color=yes fi else docker exec $pfcon_dev pytest tests/test_resources.py --color=yes fi elif [[ $ORCHESTRATOR == kubernetes ]]; then if (( b_pfconInNetwork )) ; then - kubectl exec $pfcon_dev -- pytest tests/test_resources_innetwork.py --color=yes + kubectl exec $pfcon_dev -- pixi run pytest tests/test_resources_innetwork.py --color=yes else - kubectl exec $pfcon_dev -- pytest tests/test_resources.py --color=yes + kubectl exec $pfcon_dev -- pixi run pytest tests/test_resources.py --color=yes fi fi status=$? diff --git a/swarm/docker-compose_dev.yml b/swarm/docker-compose_dev.yml index 14dc993..212d0b2 100755 --- a/swarm/docker-compose_dev.yml +++ b/swarm/docker-compose_dev.yml @@ -15,6 +15,7 @@ services: image: localhost:5000/fnndsc/pfcon:dev build: context: .. + target: build args: ENVIRONMENT: local stdin_open: true # docker run -i diff --git a/swarm/docker-compose_dev_innetwork.yml b/swarm/docker-compose_dev_innetwork.yml index eef5e96..19fc2dc 100755 --- a/swarm/docker-compose_dev_innetwork.yml +++ b/swarm/docker-compose_dev_innetwork.yml @@ -15,6 +15,7 @@ services: image: localhost:5000/fnndsc/pfcon:dev build: context: .. + target: build args: ENVIRONMENT: local stdin_open: true # docker run -i diff --git a/swarm/docker-compose_dev_innetwork_fs.yml b/swarm/docker-compose_dev_innetwork_fs.yml index 4c3152d..2c3f9c3 100755 --- a/swarm/docker-compose_dev_innetwork_fs.yml +++ b/swarm/docker-compose_dev_innetwork_fs.yml @@ -15,6 +15,7 @@ services: image: localhost:5000/fnndsc/pfcon:dev build: context: .. + target: build args: ENVIRONMENT: local stdin_open: true # docker run -i