forked from mujx/hakatime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Konstantinos Sideris
committed
May 12, 2020
1 parent
f30bf3e
commit de80796
Showing
6 changed files
with
111 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# | ||
# Build the frontend. | ||
# | ||
FROM node:10 as dashboard-builder | ||
|
||
WORKDIR /usr/src/app | ||
|
||
COPY dashboard ./ | ||
|
||
RUN npm install && npm run prod | ||
|
||
# | ||
# Build the server. | ||
# | ||
FROM alpine:edge as server-builder | ||
|
||
WORKDIR /build | ||
|
||
RUN apk upgrade --update-cache --available && \ | ||
apk add ghc \ | ||
alpine-sdk \ | ||
gmp-dev \ | ||
libffi \ | ||
libffi-dev \ | ||
musl-dev \ | ||
zlib-dev \ | ||
ncurses-dev \ | ||
postgresql-dev \ | ||
cabal \ | ||
ca-certificates && \ | ||
cabal update | ||
|
||
COPY UNLICENSE ./ | ||
COPY app/ ./app | ||
COPY README.md ./ | ||
COPY hakatime.cabal ./ | ||
COPY src/ ./src | ||
COPY test/ ./test | ||
|
||
RUN cabal build -j3 -O2 hakatime && \ | ||
cabal install -j3 -O2 hakatime && \ | ||
mkdir -p /app/bin && \ | ||
cp ~/.cabal/bin/hakatime /app/bin/hakatime | ||
|
||
FROM alpine:edge | ||
|
||
RUN apk add --no-cache \ | ||
libffi-dev \ | ||
gmp-dev \ | ||
zlib-dev \ | ||
ncurses-dev \ | ||
postgresql-dev && \ | ||
# Remove files that we don't' need. | ||
rm -rf /usr/lib/libLLVM* \ | ||
/usr/lib/libclang* \ | ||
/usr/lib/llvm10 \ | ||
/usr/lib/clang \ | ||
/usr/include | ||
|
||
COPY --from=dashboard-builder /usr/src/app/dist /app/bin/dashboard | ||
COPY --from=server-builder /app/bin/hakatime /app/bin/hakatime | ||
|
||
EXPOSE 8080 | ||
|
||
ENV HAKA_PORT 8080 | ||
ENV HAKA_DASHBOARD_PATH /app/bin/dashboard | ||
|
||
CMD ["/app/bin/hakatime", "run"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,3 +16,6 @@ ui: | |
|
||
gen-nix: | ||
cabal2nix --no-haddock --no-check . > default.nix | ||
|
||
build-img: | ||
docker build -t hakatime:latest . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,6 @@ maintainer: [email protected] | |
category: Web, UI | ||
build-type: Simple | ||
extra-doc-files: README.md | ||
, CHANGELOG.md | ||
tested-with: GHC == 8.8.3 | ||
|
||
executable hakatime | ||
|