forked from ocaml-sf/learn-ocaml
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A big difference with the previous Dockerfile is that this container holds the new learn-ocaml program, not the full web-app: it should be run with a local exercises repository. This could be used as base for a container including the exercises though, possibly using Docker multi-stage. Build the image using `make docker-image`
- Loading branch information
Showing
2 changed files
with
24 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,26 @@ | ||
FROM ocaml/opam | ||
|
||
RUN cd /home/opam/opam-repository && git pull | ||
|
||
RUN opam config exec -- opam update | ||
FROM ocaml/opam2-staging:alpine | ||
LABEL Description="learn-ocaml running container" Vendor="OCamlPro" Version="0.1" | ||
|
||
WORKDIR learn-ocaml | ||
|
||
COPY src/opam src/opam | ||
COPY scripts/install-opam-deps.sh scripts/install-opam-deps.sh | ||
COPY Makefile Makefile | ||
COPY learn-ocaml.opam . | ||
RUN sudo chown opam:nogroup learn-ocaml.opam | ||
|
||
RUN opam config exec -- make build-deps | ||
|
||
COPY . . | ||
ENV OPAMYES true | ||
RUN opam switch 4.05 | ||
RUN opam pin learn-ocaml . -n | ||
RUN opam depext learn-ocaml | ||
RUN opam install . --deps-only --locked | ||
|
||
ADD . . | ||
RUN sudo chown -R opam:nogroup . | ||
|
||
RUN opam config exec -- make REPO_DIR=exercises_repository | ||
RUN opam install . | ||
|
||
ARG port=8080 | ||
ENV port=${port} | ||
|
||
EXPOSE 9090 | ||
EXPOSE $port | ||
|
||
CMD ["/home/opam/learn-ocaml/learnocaml-simple-server.byte", "-port", "9090" ] | ||
CMD ["build","serve"] | ||
ENTRYPOINT ["/bin/bash","-c","opam exec -- learn-ocaml --sync-dir=/sync --repo=/repository --port=${port} \"$@\""] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters