-
Notifications
You must be signed in to change notification settings - Fork 17
/
Dockerfile
35 lines (26 loc) · 1.02 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
# Just a preexisting build image that has everything we need
FROM snoyberg/haskellers-build-image:e17739d1c2c043aae11924fee66c9ee4304ad37d as build
# Get the compiler in place and cached
COPY stack.yaml /tmp/stack.yaml
RUN stack setup --stack-yaml /tmp/stack.yaml
# Build just the dependencies in the cache
COPY wai-middleware-auth.cabal /tmp/
RUN stack build --only-dependencies --stack-yaml /tmp/stack.yaml
# Build the actual project
COPY . /src
RUN stack install --local-bin-path /output --stack-yaml /src/stack.yaml
# Runtime image
FROM fpco/pid1
# Set lang env var appropriately
ENV LANG C.UTF-8
# Install necessary dependencies for making SSL connections
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y \
ca-certificates \
libgmp-dev \
netbase
# Copy over the executable from the build image
COPY --from=build /output/wai-auth /usr/local/bin/wai-auth
# Set up the entrypoint correctly for local users
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]