Skip to content

Commit

Permalink
fix: Remove VOLUME ["/build"], Use default build-dir in Docker packaging
Browse files Browse the repository at this point in the history
- as externalizing the build-dir in a volume looks unneeded:
  if the build-dir is shared, but the container is deleted,
  the www is deleted as well, and the exercices are rebuilt anyway

- and as an extra volume would add more noise (mandating "-v args" tweaks)
  • Loading branch information
erikmd committed Feb 12, 2024
1 parent de42043 commit 374d8f5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ RUN apk update \
VOLUME ["/repository"]
RUN mkdir -p /sync && chown learn-ocaml:learn-ocaml /sync
VOLUME ["/sync"]
RUN mkdir -p /build && chown learn-ocaml:learn-ocaml /build
VOLUME ["/build"]
EXPOSE 8080
EXPOSE 8443

Expand All @@ -81,5 +79,5 @@ ENV OCAMLPATH="/usr/lib"
RUN ln -sf "$opam_switch/lib/vg" "/usr/lib"
RUN ln -sf "$opam_switch/lib/gg" "/usr/lib"

ENTRYPOINT ["dumb-init","/usr/bin/learn-ocaml","--sync-dir=/sync","--repo=/repository","--build-dir=/build"]
ENTRYPOINT ["dumb-init","/usr/bin/learn-ocaml","--sync-dir=/sync","--repo=/repository""]
CMD ["build","serve"]
4 changes: 1 addition & 3 deletions Dockerfile.test-server
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ RUN apk update \
VOLUME ["/repository"]
RUN mkdir -p /sync && chown learn-ocaml:learn-ocaml /sync
VOLUME ["/sync"]
RUN mkdir -p /build && chown learn-ocaml:learn-ocaml /build
VOLUME ["/build"]
EXPOSE 8080
EXPOSE 8443

Expand All @@ -75,5 +73,5 @@ COPY --from=compilation /home/opam/install-prefix /usr
COPY --from=compilation "$opam_switch/bin"/ocaml* "$opam_switch/bin/"
COPY --from=compilation "$opam_switch/lib/ocaml" "$opam_switch/lib/ocaml/"

ENTRYPOINT ["dumb-init","/usr/bin/learn-ocaml","--sync-dir=/sync","--repo=/repository","--build-dir=/build"]
ENTRYPOINT ["dumb-init","/usr/bin/learn-ocaml","--sync-dir=/sync","--repo=/repository"]
CMD ["build","serve"]

0 comments on commit 374d8f5

Please sign in to comment.