Add dockerfiles and settings checks
Signed-off-by: trivernis <trivernis@protonmail.com>pull/1/head
parent
da8b37e8fd
commit
4766ac3f52
@ -0,0 +1,11 @@
|
|||||||
|
.idea
|
||||||
|
.git
|
||||||
|
.env
|
||||||
|
.gitignore
|
||||||
|
*.md
|
||||||
|
target
|
||||||
|
Dockerfile
|
||||||
|
testdata
|
||||||
|
nodes
|
||||||
|
config
|
||||||
|
logs
|
@ -0,0 +1,18 @@
|
|||||||
|
FROM rust:alpine AS builder
|
||||||
|
RUN apk add --no-cache libgcc musl-dev
|
||||||
|
WORKDIR /usr/src
|
||||||
|
RUN USER=root cargo new snekcloud-server
|
||||||
|
WORKDIR /usr/src/snekcloud-server
|
||||||
|
COPY Cargo.toml Cargo.lock ./
|
||||||
|
COPY src ./src
|
||||||
|
RUN cargo build --release
|
||||||
|
WORKDIR target/release/
|
||||||
|
RUN ./snekcloud-server generate-key private_key
|
||||||
|
RUN timeout 1s ./snekcloud-server || exit 0
|
||||||
|
RUN cp config/00_default.toml config/10_local.toml
|
||||||
|
|
||||||
|
FROM alpine
|
||||||
|
COPY --from=builder /usr/src/snekcloud-server/target/release/snekcloud-server .
|
||||||
|
COPY --from=builder /usr/src/snekcloud-server/target/release/config /
|
||||||
|
COPY --from=builder /usr/src/snekcloud-server/target/release/private_key /
|
||||||
|
ENTRYPOINT ["./snekcloud-server"]
|
@ -0,0 +1,18 @@
|
|||||||
|
FROM rust:alpine AS builder
|
||||||
|
RUN apk add --no-cache libgcc musl-dev
|
||||||
|
WORKDIR /usr/src
|
||||||
|
RUN USER=root cargo new snekcloud-server
|
||||||
|
WORKDIR /usr/src/snekcloud-server
|
||||||
|
COPY Cargo.toml Cargo.lock ./
|
||||||
|
COPY src ./src
|
||||||
|
RUN cargo build --release
|
||||||
|
WORKDIR target/release/
|
||||||
|
RUN ./snekcloud-server generate-key private_key
|
||||||
|
RUN timeout 1s ./snekcloud-server || exit 0
|
||||||
|
RUN cp config/00_default.toml config/10_local.toml
|
||||||
|
|
||||||
|
FROM scratch
|
||||||
|
COPY --from=builder /usr/src/snekcloud-server/target/release/snekcloud-server .
|
||||||
|
COPY --from=builder /usr/src/snekcloud-server/target/release/config /
|
||||||
|
COPY --from=builder /usr/src/snekcloud-server/target/release/private_key /
|
||||||
|
ENTRYPOINT ["./snekcloud-server"]
|
Loading…
Reference in New Issue