-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
40 lines (30 loc) · 963 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
35
36
37
38
39
40
# Base image
# (TODO: need to find a slimmer alternative as the base, probably alpine or debian:sid.
# This can significantly reduce the size of image)
FROM ubuntu:18.04
# Configuring locales
ENV LANG en_US.UTF-8
ENV LC_ALL C.UTF-8
# setting up binaries/libraries
RUN apt-get update && apt-get install -y \
curl
# fetching stack to build haskell projects
RUN curl -sSL https://get.haskellstack.org/ | sh
# updating the path and stack version
ENV PATH="/root/.local/bin:${PATH}"
RUN stack upgrade
# creating project directory
RUN mkdir -p /haskeme
# copying config files from local machine into dir
COPY stack.yaml /haskeme
COPY *.cabal /haskeme
# changing pwd
WORKDIR /haskeme
# copying all the source, test and script files (TODO: check if .dockerignore files are also being added)
COPY . .
# building the haskell project
RUN stack setup && \
stack build --test && \
stack install
# run the project with haskeme cli
CMD ["haskeme"]