Skip to content

Commit 2d5dd96

Browse files
committed
Set target as build stage for development image
1 parent de79e4d commit 2d5dd96

5 files changed

+11
-6
lines changed

Dockerfile

+4-2
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@ ARG ENVIRONMENT=prod
1111
RUN printf '#!/bin/sh\n%s\nexec "$@"' "$(pixi shell-hook -e ${ENVIRONMENT})" > /entrypoint.sh
1212
RUN chmod +x /entrypoint.sh
1313

14+
FROM build as prod-build
15+
1416
# must be the last command of this stage, or else pixi will overwrite the installed package.
1517
RUN pixi run postinstall-production
1618

1719
FROM docker.io/library/debian:bookworm-slim
1820

19-
COPY --from=build /app/.pixi/envs/${ENVIRONMENT} /app/.pixi/envs/${ENVIRONMENT}
20-
COPY --from=build /entrypoint.sh /entrypoint.sh
21+
COPY --from=prod-build /app/.pixi/envs/${ENVIRONMENT} /app/.pixi/envs/${ENVIRONMENT}
22+
COPY --from=prod-build /entrypoint.sh /entrypoint.sh
2123

2224
ENTRYPOINT [ "/entrypoint.sh" ]
2325
CMD ["gunicorn", "--bind", "0.0.0.0:5005", "--workers", "8", "--timeout", "3600", "pfcon.wsgi:application"]

make.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -307,18 +307,18 @@ if (( ! b_skipUnitTests )) ; then
307307
if [[ $ORCHESTRATOR == swarm ]]; then
308308
if (( b_pfconInNetwork )) ; then
309309
if [[ $STORAGE == 'swift' ]]; then
310-
docker exec $pfcon_dev pytest tests/test_resources_innetwork.py --color=yes
310+
docker exec $pfcon_dev pixi run pytest tests/test_resources_innetwork.py --color=yes
311311
elif [[ $STORAGE == 'filesystem' ]]; then
312-
docker exec $pfcon_dev pytest tests/test_resources_innetwork_fs.py --color=yes
312+
docker exec $pfcon_dev pixi run pytest tests/test_resources_innetwork_fs.py --color=yes
313313
fi
314314
else
315315
docker exec $pfcon_dev pytest tests/test_resources.py --color=yes
316316
fi
317317
elif [[ $ORCHESTRATOR == kubernetes ]]; then
318318
if (( b_pfconInNetwork )) ; then
319-
kubectl exec $pfcon_dev -- pytest tests/test_resources_innetwork.py --color=yes
319+
kubectl exec $pfcon_dev -- pixi run pytest tests/test_resources_innetwork.py --color=yes
320320
else
321-
kubectl exec $pfcon_dev -- pytest tests/test_resources.py --color=yes
321+
kubectl exec $pfcon_dev -- pixi run pytest tests/test_resources.py --color=yes
322322
fi
323323
fi
324324
status=$?

swarm/docker-compose_dev.yml

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ services:
1515
image: localhost:5000/fnndsc/pfcon:dev
1616
build:
1717
context: ..
18+
target: build
1819
args:
1920
ENVIRONMENT: local
2021
stdin_open: true # docker run -i

swarm/docker-compose_dev_innetwork.yml

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ services:
1515
image: localhost:5000/fnndsc/pfcon:dev
1616
build:
1717
context: ..
18+
target: build
1819
args:
1920
ENVIRONMENT: local
2021
stdin_open: true # docker run -i

swarm/docker-compose_dev_innetwork_fs.yml

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ services:
1515
image: localhost:5000/fnndsc/pfcon:dev
1616
build:
1717
context: ..
18+
target: build
1819
args:
1920
ENVIRONMENT: local
2021
stdin_open: true # docker run -i

0 commit comments

Comments
 (0)