-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use alpine base image and a builder stage
- Loading branch information
Showing
2 changed files
with
21 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.git/ | ||
target/ | ||
Dockerfile | ||
docker-compose.yml | ||
shell.nix | ||
nix/ | ||
openapi/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,23 @@ | ||
FROM rustlang/rust:nightly-buster | ||
FROM rustlang/rust:nightly-alpine AS builder | ||
|
||
WORKDIR /usr/src/zauth | ||
|
||
RUN apt-get update && apt-get install -y netcat | ||
RUN apk add --no-cache musl-dev mariadb-connector-c-dev postgresql-dev sqlite-dev | ||
|
||
RUN cargo install diesel_cli | ||
COPY . . | ||
RUN cargo install --path . | ||
|
||
FROM alpine | ||
|
||
WORKDIR /usr/src/zauth | ||
|
||
RUN apk add --no-cache netcat-openbsd libpq | ||
COPY --from=builder /usr/local/cargo/bin/diesel /usr/local/cargo/bin/zauth /usr/local/bin/ | ||
COPY Rocket.toml diesel.toml /usr/src/zauth/ | ||
COPY migrations/ migrations/ | ||
COPY docker_misc/ docker_misc/ | ||
COPY static/ static/ | ||
|
||
ENV ROCKET_ENV production | ||
CMD ["zauth"] | ||
CMD ["zauth"] |