-
Notifications
You must be signed in to change notification settings - Fork 24
Add rust Dockerfile #80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| target/ |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| # Build stage | ||
| FROM rust:1.91-bookworm AS builder | ||
|
|
||
| WORKDIR /build | ||
|
|
||
| # Copy workspace files | ||
| COPY Cargo.toml Cargo.lock ./ | ||
| COPY rustfmt.toml ./ | ||
|
|
||
| # Copy all workspace members | ||
| COPY server ./server | ||
| COPY api ./api | ||
| COPY impls ./impls | ||
| COPY auth-impls ./auth-impls | ||
|
|
||
| # Build the application in release mode | ||
| RUN cargo build --locked --release --bin vss-server | ||
|
|
||
| # Runtime stage | ||
| FROM debian:bookworm-slim | ||
|
|
||
| # Install runtime dependencies and create an unprivileged runtime user | ||
| RUN apt-get update && \ | ||
| apt-get install -y --no-install-recommends \ | ||
| ca-certificates \ | ||
| libssl3 \ | ||
| && rm -rf /var/lib/apt/lists/* \ | ||
| && groupadd --system vss \ | ||
| && useradd --system --gid vss --home-dir /app --shell /usr/sbin/nologin vss \ | ||
| && mkdir -p /app \ | ||
| && chown vss:vss /app | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| # Copy the compiled binary from builder | ||
| COPY --from=builder --chown=vss:vss /build/target/release/vss-server /app/vss-server | ||
|
|
||
| # Copy default configuration file | ||
| COPY --chown=vss:vss server/vss-server-config.toml /app/vss-server-config.toml | ||
|
|
||
| USER vss:vss | ||
|
|
||
| ENV VSS_BIND_ADDRESS=0.0.0.0:8080 | ||
|
|
||
| EXPOSE 8080 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems by default this will only bind to localhost. Do we need to set
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks made a couple more passes with codex, see below |
||
|
|
||
| # Run the server with the config file | ||
| CMD ["/app/vss-server", "/app/vss-server-config.toml"] | ||
Uh oh!
There was an error while loading. Please reload this page.