-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
42 lines (32 loc) · 1.24 KB
/
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
40
41
42
FROM rust:slim-bullseye as builder
ENV DEBIAN_FRONTEND=noninteractive
ENV NEEDRESTART_MODE=a
RUN apt-get update && apt-get dist-upgrade -y
RUN apt-get install -y python3 python3-pip python3-setuptools --no-install-recommends
RUN apt-get install -y protobuf-compiler build-essential libssl-dev pkg-config git cmake
RUN apt-get autoremove
# Nonsensical, but allows us to cache requirements.
RUN mkdir /build
COPY requirements.txt /build/requirements.txt
RUN pip3 install --no-cache-dir -r /build/requirements.txt
COPY . /build
ENV DOC_SOURCE=docs
WORKDIR /build/docgen
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/build/docgen/target \
--mount=type=cache,target=/build/cache/zq2 \
cargo run /build
WORKDIR /build/zq2
ARG VERSION
ENV VERSION=$VERSION
RUN mkdocs build
WORKDIR /build/zq1
RUN mkdocs build -f mkdocs.zq2.yml;
FROM nginx:alpine-slim
RUN mkdir -p /usr/share/nginx/html/zilliqa1
RUN mkdir -p /usr/share/nginx/html/zilliqa2
COPY --from=builder --chown=nginx:nginx /build/zq1/site/. /usr/share/nginx/html/zilliqa1/.
COPY --from=builder --chown=nginx:nginx /build/zq2/site/. /usr/share/nginx/html/zilliqa2/.
COPY default.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]