-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
63 lines (48 loc) · 1.16 KB
/
Dockerfile
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Stage 1: Build stage
FROM debian:bullseye AS builder
WORKDIR /app
RUN \
apt-get update -y && \
apt-get install -y build-essential \
curl \
libnuma-dev \
zlib1g-dev \
libgmp-dev \
libgmp10 \
git \
wget \
lsb-release \
software-properties-common \
gnupg2 \
apt-transport-https \
gcc \
autoconf \
automake \
pkg-config
RUN \
curl https://downloads.haskell.org/~ghcup/x86_64-linux-ghcup -o /usr/bin/ghcup && \
chmod +x /usr/bin/ghcup
ARG GHC=9.4.8
ARG CABAL=3.10
RUN \
ghcup -v install ghc --isolate /usr/local --force ${GHC} && \
ghcup -v install cabal --isolate /usr/local/bin --force ${CABAL}
ENV PATH="/root/.ghcup/bin:${PATH}"
COPY . .
RUN \
cabal update && \
cabal install --installdir=/app exe:chemist-preprocessor && \
cabal build
# Stage 2: Runtime stage
FROM debian:bullseye-slim
WORKDIR /app
COPY --from=builder /app/chemist-preprocessor /app/chemist-preprocessor
COPY .env /app/.env
RUN chmod +x /app/chemist-preprocessor
RUN apt-get update && \
apt-get install -y libnuma1 libgmp10 && \
apt-get autoremove -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
EXPOSE 8080
CMD ["/app/chemist-preprocessor"]