forked from mujx/hakatime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.arm
64 lines (46 loc) · 1.61 KB
/
Dockerfile.arm
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#
# Build the frontend.
#
FROM node:12.18 as dashboard-builder
WORKDIR /usr/src/app
COPY dashboard ./
RUN yarn install --network-timeout 1000000000
COPY .git ./
RUN yarn run prod && rm -rf .git
#
# Build the server.
#
FROM ubuntu:20.10 as server-builder
WORKDIR /build
RUN apt-get update -y -qq && \
apt-get install --no-install-recommends -y curl ghc cabal-install libffi-dev libpq-dev libgmp-dev zlib1g-dev
COPY UNLICENSE ./
COPY app/ ./app
COPY README.md ./
COPY hakatime.cabal ./
COPY cabal.project ./
COPY src/ ./src
COPY sql/ ./sql
COPY test/ ./test
COPY tools/ ./tools
WORKDIR /build
RUN cabal update
RUN cabal configure --disable-optimization && \
cabal build -j2 exe:hakatime && mkdir -p /app/bin && \
cp /build/dist-newstyle/build/*-linux/ghc-*/hakatime-*/x/hakatime/opt/build/hakatime/hakatime /app/bin/hakatime
FROM ubuntu:20.10
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -y -qq && \
apt-get install --no-install-recommends -y netcat libffi-dev libgmp-dev libpq-dev zlib1g-dev postgresql && \
apt-get remove -y perl && \
apt-get autoremove -y && \
apt-get autoclean && \
rm -rf /usr/lib/x86_64-linux-gnu/libLLVM* /usr/lib/x86_64-linux-gnu/libicudata.so*
COPY --from=dashboard-builder /usr/src/app/dist /app/bin/dashboard
COPY --from=server-builder /app/bin/hakatime /app/bin/hakatime
COPY docker/init.sql /app/init.sql
COPY docker/start.sh /app/start.sh
COPY migrations/ /app/migrations
ENV HAKA_PORT 8080
ENV HAKA_DASHBOARD_PATH /app/bin/dashboard
CMD ["/app/start.sh"]