-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathDockerfile.rustms-server
More file actions
45 lines (36 loc) · 1.07 KB
/
Dockerfile.rustms-server
File metadata and controls
45 lines (36 loc) · 1.07 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
# syntax=docker/dockerfile:1.7
FROM rust:1.87-alpine AS builder
WORKDIR /app
RUN apk add --no-cache \
build-base \
musl-dev \
openssl-dev \
postgresql-dev \
pkgconf
ENV RUSTFLAGS="-C target-feature=-crt-static"
COPY Cargo.toml Cargo.lock ./
COPY config config
COPY crypt crypt
COPY db db
COPY game-data game-data
COPY integration-harness integration-harness
COPY net net
COPY packet packet
COPY runtime runtime
COPY rust-ms rust-ms
COPY tools tools
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/usr/local/cargo/git \
--mount=type=cache,target=/app/target \
cargo build -p rust-ms --bin login --bin world --release \
&& mkdir -p /out \
&& cp /app/target/release/login /out/login \
&& cp /app/target/release/world /out/world
FROM alpine:3.22
RUN apk add --no-cache ca-certificates libpq libgcc libstdc++ \
&& adduser -D rustms
WORKDIR /app
COPY --from=builder /out/login /usr/local/bin/login
COPY --from=builder /out/world /usr/local/bin/world
COPY --from=builder /app/config /app/config
USER rustms