-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
35 lines (24 loc) · 847 Bytes
/
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
FROM haskell:8.6.3 as mybuild
# Checkout our code onto the Docker container
RUN apt-get update && apt-get install -y postgresql libpq-dev
WORKDIR /app
# First install all dependancies (only if either package.yaml or stack.yaml change)
COPY ./application/package.yaml /app/package.yaml
COPY ./application/stack.yaml /app/stack.yaml
WORKDIR /app
RUN stack setup
RUN stack build --dependencies-only
# Copy the whole application across
COPY ./application /app
# Build the application
RUN stack setup && \
stack build --test --copy-bins
FROM nginx:latest
RUN mkdir -p /usr/share/man/man1 && \
mkdir -p /usr/share/man/man7 && \
apt-get update && \
apt-get install -y postgresql libpq-dev supervisor
COPY --from=mybuild /root/.local/bin/backend-exe /bin/backend-exe
COPY ./docker /
# Run the server command
CMD ["supervisord"]