-
-
Notifications
You must be signed in to change notification settings - Fork 320
/
Dockerfile
37 lines (25 loc) · 817 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
FROM haskell as dev
RUN mkdir /root/hledger
WORKDIR /root/hledger
# Install GHC
COPY ./stack*.yaml ./
RUN stack setup
# Pre-cache dependencies
RUN mkdir hledger-lib hledger hledger-ui hledger-web
COPY hledger-lib/package.yaml hledger-lib/package.yaml
COPY hledger/package.yaml hledger/package.yaml
COPY hledger-ui/package.yaml hledger-ui/package.yaml
COPY hledger-web/package.yaml hledger-web/package.yaml
RUN stack install --dependencies-only
# Actually compile sources
COPY . .
RUN stack install
FROM debian:stable-slim
RUN apt-get update && apt-get install libtinfo5 libgmp10 && rm -rf /var/lib/apt/lists
COPY --from=dev /root/.local/bin/hledger* /usr/bin/
ENV LC_ALL C.UTF-8
RUN mkdir /data && touch /data/hledger.journal
VOLUME /data
EXPOSE 5000 5001
COPY docker/start.sh /start.sh
CMD ["/start.sh"]