Skip to content

Commit 8da288e

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

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

docker-compose.yml

-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

docker/dev/django/Dockerfile

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

1013
# Inspiration
1114
# https://github.com/azavea/docker-django/blob/1ef366/Dockerfile-slim.template
@@ -16,6 +19,7 @@ ENV PYTHONUNBUFFERED=1
1619
# Set ipdb as the default debugger.
1720
# https://www.andreagrandi.it/2018/10/16/using-ipdb-with-python-37-breakpoint/
1821
ENV PYTHONBREAKPOINT=ipdb.set_trace
22+
ENV XDG_CACHE_HOME=$XDG_CACHE_HOME
1923

2024
# Install tools to setup the PostgreSQL reposity
2125
RUN set -ex; \
@@ -49,6 +53,10 @@ RUN set -ex \
4953

5054
RUN echo '. "$VIRTUAL_ENV"/bin/activate' >> /home/.bashrc
5155

56+
# Setup app cache dir
57+
RUN mkdir -p $XDG_CACHE_HOME \
58+
&& chown $APP_USER: $XDG_CACHE_HOME
59+
5260
# Setup the entrypoint
5361
COPY --chown=$APP_USER:$APP_USER --chmod=755 ./docker/dev/django/entrypoint.sh /entrypoint.sh
5462
ENTRYPOINT ["/entrypoint.sh"]

0 commit comments

Comments
 (0)