Skip to content

Commit c2f96d5

Browse files
author
Cuihtlauac ALVARADO
committed
Revert "Dockerfile cleanup (#2861)"
This reverts commit 620b813.
1 parent 620b813 commit c2f96d5

File tree

1 file changed

+18
-27
lines changed

1 file changed

+18
-27
lines changed

Dockerfile

Lines changed: 18 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,32 @@
1-
FROM ocaml/opam:alpine-3.20-ocaml-5.2 AS build
1+
FROM ocaml/opam:alpine-3.20-ocaml-5.2 as build
22

33
# Install system dependencies
4-
RUN sudo apk -U upgrade --no-cache && sudo apk add --no-cache \
5-
autoconf \
6-
curl-dev \
7-
gmp-dev \
8-
inotify-tools \
9-
libev-dev \
10-
oniguruma-dev \
11-
openssl-dev
4+
RUN sudo apk update && sudo apk add --update libev-dev openssl-dev gmp-dev oniguruma-dev inotify-tools curl-dev autoconf
125

136
# Branch freeze was opam-repo HEAD at the time of commit
14-
RUN cd ~/opam-repository && git fetch -q origin master && git reset --hard c45f5bab71d3589f41f9603daca5acad14df0ab0 && opam update
7+
RUN cd opam-repository && git pull origin c45f5bab71d3589f41f9603daca5acad14df0ab0 && opam update
158

169
WORKDIR /home/opam
1710

18-
# Install opam dependencies
19-
COPY --chown=opam ocamlorg.opam .
11+
# Install Opam dependencies
12+
ADD ocamlorg.opam ocamlorg.opam
2013
RUN opam install . --deps-only
2114

2215
# Build project
23-
COPY --chown=opam . .
16+
COPY --chown=opam:opam . .
2417
RUN opam exec -- dune build @install --profile=release
2518

2619
# Launch project in order to generate the package state cache
27-
RUN cd ~/opam-repository && git checkout master && opam update
28-
ENV OCAMLORG_PKG_STATE_PATH=package.state \
29-
OCAMLORG_REPO_PATH=opam-repository
20+
RUN cd opam-repository && git checkout master && git pull origin master && opam update
21+
ENV OCAMLORG_REPO_PATH opam-repository
22+
ENV OCAMLORG_PKG_STATE_PATH package.state
3023
RUN touch package.state && ./init-cache package.state
3124

25+
FROM alpine:3.20 as run
3226

33-
FROM alpine:3.20
27+
RUN apk update && apk add --update libev gmp git
3428

35-
RUN apk -U upgrade --no-cache && apk add --no-cache \
36-
git \
37-
gmp \
38-
libev
29+
RUN chmod -R 755 /var
3930

4031
COPY --from=build /home/opam/package.state /var/package.state
4132
COPY --from=build /home/opam/opam-repository /var/opam-repository
@@ -47,12 +38,12 @@ RUN git clone https://github.com/ocaml-web/html-compiler-manuals /manual
4738

4839
RUN git config --global --add safe.directory /var/opam-repository
4940

50-
ENV DREAM_VERBOSITY=info \
51-
OCAMLORG_HTTP_PORT=8080 \
52-
OCAMLORG_MANUAL_PATH=/manual \
53-
OCAMLORG_PKG_STATE_PATH=/var/package.state \
54-
OCAMLORG_REPO_PATH=/var/opam-repository/
41+
ENV OCAMLORG_REPO_PATH /var/opam-repository/
42+
ENV OCAMLORG_MANUAL_PATH /manual
43+
ENV OCAMLORG_PKG_STATE_PATH /var/package.state
44+
ENV DREAM_VERBOSITY info
45+
ENV OCAMLORG_HTTP_PORT 8080
5546

5647
EXPOSE 8080
5748

58-
ENTRYPOINT ["/bin/server"]
49+
ENTRYPOINT /bin/server

0 commit comments

Comments
 (0)