-
Notifications
You must be signed in to change notification settings - Fork 49
/
Dockerfile.arm
61 lines (45 loc) · 1.58 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
#
# Build the frontend.
#
FROM node:18-bullseye as dashboard-builder
WORKDIR /usr/src/app
COPY dashboard ./
COPY .git ./
RUN yarn install --network-timeout 1000000000 && \
yarn run prod
#
# Build the server.
#
FROM ubuntu:22.04 as server-builder
WORKDIR /build
RUN apt-get update -y -qq && \
apt-get install -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 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:22.04
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 postgresql-client ca-certificates curl && \
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"]