-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathenv.dockerfile
48 lines (30 loc) · 857 Bytes
/
env.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
43
44
45
46
47
48
FROM rust:latest as base
RUN apt-get update -y && apt-get upgrade -y
FROM base as builder-base
RUN apt-get install -y \
protobuf-compiler
RUN rustup update && \
rustup default nightly && \
rustup target add wasm32-unknown-unknown wasm32-wasi --toolchain nightly
FROM builder-base as builder
ENV CARGO_TERM_COLOR=always
ADD . /workspace
WORKDIR /workspace
COPY . .
RUN cargo build --release -v --workspace
FROM debian:buster-slim as runner-base
ENV RUST_LOG="info" \
SERVER_PORT=8080
RUN apt-get update -y && apt-get upgrade -y
RUN apt-get install -y \
protobuf-compiler
RUN mkdir data
VOLUME [ "/data" ]
COPY --chown=55 .config /config
VOLUME [ "/config" ]
COPY --chown=55 --from=builder /workspace/target/release/app /bin/app
FROM runner-base as runner
EXPOSE 80
EXPOSE ${SERVER_PORT}
ENTRYPOINT [ "app" ]
CMD [ "-h" ]