forked from linagora/twake-on-matrix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
29 lines (25 loc) · 978 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
# Specify versions
ARG FLUTTER_VERSION=3.16.5
ARG OLM_VERSION=3.2.15
# Building libolm
# libolm only has amd64
FROM --platform=linux/amd64 nixos/nix AS olm-builder
ARG OLM_VERSION
RUN nix build -v --extra-experimental-features flakes --extra-experimental-features nix-command gitlab:matrix-org/olm/${OLM_VERSION}?host=gitlab.matrix.org\#javascript
# Building Twake for the web
FROM --platform=linux/amd64 ghcr.io/cirruslabs/flutter:${FLUTTER_VERSION} AS web-builder
COPY . /app
WORKDIR /app
RUN DEBIAN_FRONTEND=noninteractive apt update && \
apt install -y openssh-client && \
rm -rf assets/js/* && \
mkdir ~/.ssh && \
ssh-keyscan github.com >> ~/.ssh/known_hosts
COPY --from=olm-builder /result/javascript assets/js/package
RUN --mount=type=ssh,required=true ./scripts/build-web.sh
# Final image
FROM nginx:alpine AS final-image
RUN rm -rf /usr/share/nginx/html
COPY --from=web-builder /app/build/web /usr/share/nginx/html/web/
# Specify the port
EXPOSE 80