diff --git a/Dockerfile b/Dockerfile index 5d6b6f9b..0d820eb1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,6 @@ FROM perl:5.40-bookworm ENV ANYEVENT_WEBSOCKET_TEST_SKIP_SSL=1 -COPY . /home/lacuna/server WORKDIR /home/lacuna/server # System libraries the XS dependencies link against (Debian package names). @@ -32,12 +31,16 @@ RUN cpanm --notest Carton RUN cpanm --notest -l local --build-timeout=3600 --configure-timeout=1800 \ Memcached::libmemcached@1.001801 +COPY ./cpanfile ./cpanfile.snapshot /home/lacuna/server + # With a committed cpanfile.snapshot, install strictly from it (reproducible). # On the very first build (no snapshot yet), resolve freely and generate one — # extract it with `docker cp` and commit it, then all later builds are pinned. RUN carton install --deployment \ && rm -rf /root/.cpanm /root/.perl-cpm +COPY . /home/lacuna/server + # Carton installs into ./local — put its binaries and libs on the default # search paths so `plackup` / `perl` in bin/startdev.sh and the compose # `command:` lines resolve without needing `carton exec`.