-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
27 lines (18 loc) · 720 Bytes
/
Copy pathDockerfile
File metadata and controls
27 lines (18 loc) · 720 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
FROM haskell:9.8-slim-bullseye AS build
WORKDIR /src
COPY cabal.project openleetcode.cabal ./
COPY cli ./cli
COPY core ./core
RUN cabal update \
&& cabal build exe:openleetcode \
&& exe="$(find dist-newstyle -type f -path '*/x/openleetcode/build/openleetcode/openleetcode' | head -n 1)" \
&& test -n "$exe" \
&& install -D "$exe" /out/openleetcode
FROM debian:bullseye-slim
LABEL org.opencontainers.image.source="https://github.com/therepanic/openleetcode"
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates libgmp10 \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --from=build /out/openleetcode /usr/local/bin/openleetcode
ENTRYPOINT ["openleetcode"]