Skip to content

Commit

Permalink
Set target as build stage for development image
Browse files Browse the repository at this point in the history
  • Loading branch information
jennydaman committed Aug 29, 2024
1 parent de79e4d commit 2d5dd96
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
8 changes: 4 additions & 4 deletions make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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=$?
Expand Down
1 change: 1 addition & 0 deletions swarm/docker-compose_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ services:
image: localhost:5000/fnndsc/pfcon:dev
build:
context: ..
target: build
args:
ENVIRONMENT: local
stdin_open: true # docker run -i
Expand Down
1 change: 1 addition & 0 deletions swarm/docker-compose_dev_innetwork.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ services:
image: localhost:5000/fnndsc/pfcon:dev
build:
context: ..
target: build
args:
ENVIRONMENT: local
stdin_open: true # docker run -i
Expand Down
1 change: 1 addition & 0 deletions swarm/docker-compose_dev_innetwork_fs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ services:
image: localhost:5000/fnndsc/pfcon:dev
build:
context: ..
target: build
args:
ENVIRONMENT: local
stdin_open: true # docker run -i
Expand Down

0 comments on commit 2d5dd96

Please sign in to comment.