-
Notifications
You must be signed in to change notification settings - Fork 4
/
hub.Dockerfile
40 lines (29 loc) · 1.04 KB
/
hub.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
###########################################################
# Stage 1: Build the Haskell application
FROM haskell:latest AS build
RUN apt-get update && apt-get install -y \
libgmp-dev \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY package.yaml stack.yaml stack.yaml.lock wrench.cabal /app/
RUN stack setup --install-ghc
RUN stack build --only-dependencies
COPY . /app
RUN stack build --ghc-options -O2 --copy-bins --local-bin-path /app/.local/bin
###########################################################
# Stage 2: Create a minimal runtime container
FROM debian:bullseye-slim
RUN apt-get update && apt-get install -y libgmp10 libc6-dev locales \
&& echo "en_US.UTF-8 UTF-8" > /etc/locale.gen \
&& echo "ru_RU.UTF-8 UTF-8" >> /etc/locale.gen \
&& locale-gen \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US:en
ENV LC_ALL=en_US.UTF-8
WORKDIR /app
COPY --from=build /app/.local/bin/wrench /app/.local/bin/wrench-serv /bin/
COPY static /app/static
EXPOSE 8080
CMD ["wrench-serv"]