Move code from image to volume

Created execution script for the container image and moved code
copy from Dockerfile to volume in compose.

Now code changes don't require image rebuild.
This commit is contained in:
Lauri Koskenniemi 2025-09-15 20:27:18 +03:00
parent adb5502cb8
commit ae76ebc003
3 changed files with 14 additions and 3 deletions

View File

@ -4,7 +4,7 @@ RUN apk add --no-cache \
py3-yaml \
graphviz
WORKDIR /code
COPY code/ .
COPY run.sh /run.sh
RUN chmod +x /run.sh
CMD ["python3", "puudot.py"]
CMD ["/run.sh"]

View File

@ -6,5 +6,6 @@ services:
dockerfile: Dockerfile
image: puudot:latest
volumes:
- ./code:/code
- ./data:/data
- ./config.yaml:/config.yaml

10
run.sh Normal file
View File

@ -0,0 +1,10 @@
#!/bin/sh
# Check if puudot.py exists
if [ ! -f "/code/puudot.py" ]; then
echo "Error: puudot.py not found in /code directory!"
exit 1
fi
# Run the script
python3 /code/puudot.py