Skip to content

Commit b8f223d

Browse files
committed
docker: add a cache dir writable by docker user
Now required by uv Refs: #3682
1 parent 9190dc7 commit b8f223d

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

docker-compose.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ services:
5656
- PGPASSWORD=password
5757
- PYTHONPATH=.
5858
- ITOU_LOG_LEVEL=DEBUG
59-
- ITOU_CACHE=/app/.cache
6059
- CELLAR_ADDON_HOST=minio:${MINIO_PORT_ON_DOCKER_HOST:-9000}
6160
- VIRTUAL_ENV=/app/.venv-docker
6261
- REDIS_URL=redis://redis:6379
@@ -73,6 +72,7 @@ services:
7372
volumes:
7473
# Mount the current directory into `/app` inside the running container.
7574
- .:/app
75+
- cache:/app_cache
7676
restart: unless-stopped
7777
ports:
7878
- "127.0.0.1:${DJANGO_PORT_ON_DOCKER_HOST:-8000}:8000"
@@ -86,3 +86,4 @@ services:
8686
volumes:
8787
postgres_data:
8888
itou_minio:
89+
cache:

docker/dev/django/Dockerfile

+6
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ FROM python:$PYTHON_VERSION-slim
66
ARG APP_USER
77
ARG APP_DIR
88
ARG PG_MAJOR
9+
ARG XDG_CACHE_HOME="/app_cache"
910

1011
# Inspiration
1112
# https://github.com/azavea/docker-django/blob/1ef366/Dockerfile-slim.template
@@ -16,6 +17,7 @@ ENV PYTHONUNBUFFERED=1
1617
# Set ipdb as the default debugger.
1718
# https://www.andreagrandi.it/2018/10/16/using-ipdb-with-python-37-breakpoint/
1819
ENV PYTHONBREAKPOINT=ipdb.set_trace
20+
ENV XDG_CACHE_HOME=$XDG_CACHE_HOME
1921

2022
# Install tools to setup the PostgreSQL reposity
2123
RUN set -ex; \
@@ -49,6 +51,10 @@ RUN set -ex \
4951

5052
RUN echo '. "$VIRTUAL_ENV"/bin/activate' >> /home/.bashrc
5153

54+
# Setup app cache dir
55+
RUN mkdir -p $XDG_CACHE_HOME \
56+
&& chown $APP_USER: $XDG_CACHE_HOME
57+
5258
# Setup the entrypoint
5359
COPY --chown=$APP_USER:$APP_USER --chmod=755 ./docker/dev/django/entrypoint.sh /entrypoint.sh
5460
ENTRYPOINT ["/entrypoint.sh"]

0 commit comments

Comments
 (0)