forked from nationalarchives/miiify
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
39 lines (24 loc) · 970 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
FROM ocaml/opam:alpine as build
# Install system dependencies
RUN sudo apk add --update libev-dev openssl-dev gmp-dev libffi-dev
WORKDIR /home/opam
# Install dependencies
ADD miiify.opam miiify.opam
RUN opam pin add -n dream https://github.com/aantron/dream.git
RUN opam pin add -n dream-httpaf https://github.com/aantron/dream.git
RUN opam install . --deps-only
# Build project
ADD . .
RUN opam exec -- dune build
FROM alpine as run
RUN adduser miiify --disabled-password
RUN apk add --update libev gmp openssl musl
WORKDIR /home/miiify
COPY --from=build /home/opam/_build/default/bin/main.exe ./app
COPY VERSION VERSION
COPY DESCRIPTION DESCRIPTION
COPY assets assets
USER miiify
COPY config.json /home/miiify/config.json
RUN openssl req -x509 -newkey rsa:4096 -keyout server.key -out server.crt -days 3650 -nodes -subj "/C=UK/ST=foo/L=bar/O=baz/OU= Department/CN=localhost.local"
ENTRYPOINT ["/home/miiify/app", "--config", "/home/miiify/config.json"]