-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (22 loc) · 765 Bytes
/
Dockerfile
File metadata and controls
35 lines (22 loc) · 765 Bytes
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
# -*- mode: dockerfile -*-
# Dockerfile for spa-server
# You can override this `--build-arg BASE_IMAGE=...` to use different
# version of Rust
ARG BASE_IMAGE=rust:alpine
ARG RUNTIME_IMAGE=alpine
# Our first FROM statement declares the build environment.
FROM ${BASE_IMAGE} AS builder
# Add our source code.
ADD . .
RUN apk add --no-cache musl-dev
# Build our application.
RUN --mount=type=cache,target=/usr/local/cargo/registry \
cargo build --package spa-server --release
FROM ${RUNTIME_IMAGE}
ENV SPA_CONFIG="/config/config.toml"
RUN mkdir /data
RUN apk add --no-cache tini
COPY --from=builder ./config.release.toml /config/config.toml
COPY --from=builder ./target/release/spa-server /usr/bin/
ENTRYPOINT ["/sbin/tini", "--"]
CMD ["spa-server"]