-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathServer.Dockerfile
More file actions
60 lines (47 loc) · 1.81 KB
/
Copy pathServer.Dockerfile
File metadata and controls
60 lines (47 loc) · 1.81 KB
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
FROM keynmol/sn-vcpkg:latest as dev
# Install all native dependencies
RUN apt-get update && apt-get install -y curl build-essential libpcre2-dev && \
apt install -y lsb-release wget software-properties-common gnupg
WORKDIR /workdir
# install vcpkg dependencies
RUN sn-vcpkg bootstrap
COPY vcpkg.json .
ENV VCPKG_FORCE_SYSTEM_BINARIES=1
RUN sn-vcpkg install -v --manifest vcpkg.json
ENV LC_CTYPE=en_US.UTF-8
ENV LANG=en_US.UTF-8
# pre-download SBT
COPY project/build.properties project/
RUN sbt --sbt-create version
# build app
ENV CI=true
ENV LLVM_BIN=/usr/lib/llvm-17/bin
RUN if [ "$(uname -m)" = "x86_64" ]; then \
curl -Lo node-install.tar.xz https://nodejs.org/dist/v22.18.0/node-v22.18.0-linux-x64.tar.xz; \
else \
curl -Lo node-install.tar.xz https://nodejs.org/dist/v22.18.0/node-v22.18.0-linux-arm64.tar.xz; \
fi && \
tar -xf node-install.tar.xz && rm *.tar.xz && mv node-v22* node-install
ENV PATH /workdir/node-install/bin:$PATH
COPY project/plugins.sbt project/
COPY project/*.scala project/
COPY build.sbt .
COPY .jvmopts .
COPY modules/bindings/src modules/bindings/src
COPY modules/http-server/src modules/http-server/src
COPY modules/protocols/src modules/protocols/src
COPY modules/frontend modules/frontend
RUN curl -Lo llvm.sh https://apt.llvm.org/llvm.sh && \
chmod +x llvm.sh && \
./llvm.sh 17
ENV LLVM_BIN=/usr/lib/llvm-17/bin
RUN sbt httpServer/buildBinaryRelease buildWebappRelease
FROM ubuntu:jammy
WORKDIR /workdir
RUN apt update && apt install -y nginx
COPY --from=dev /workdir/out/release/bindgen-web-http-server /app/web
COPY --from=dev /workdir/out/release/frontend /app/static/
COPY modules/nginx/nginx.conf /etc/nginx/sites-available/default
COPY modules/nginx/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
EXPOSE 80
CMD [ "/usr/local/bin/docker-entrypoint.sh" ]