-
Notifications
You must be signed in to change notification settings - Fork 20
Chore/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,47 @@ | ||
| # 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 --release --bin vss-server | ||
|
|
||
| # Runtime stage | ||
| FROM debian:bookworm-slim | ||
|
|
||
| # Install runtime dependencies | ||
| RUN apt-get update && \ | ||
| apt-get install -y --no-install-recommends \ | ||
| ca-certificates \ | ||
| libssl3 \ | ||
|
Comment on lines
+25
to
+26
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. Wasn't aware of these dependencies are you sure these are needed ? |
||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| # Copy the compiled binary from builder | ||
| COPY --from=builder /build/target/release/vss-server /app/vss-server | ||
|
|
||
| # Copy default configuration file | ||
| #COPY server/vss-server-config.toml /app/vss-server-config.toml | ||
|
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. For now this step is mandatory, so let's not comment it out. |
||
|
|
||
| # Environment variables for PostgreSQL connection | ||
| #ENV VSS_POSTGRESQL_USERNAME=postgres | ||
| #ENV VSS_POSTGRESQL_PASSWORD=YOU_MUST_CHANGE_THIS_PASSWORD | ||
| #ENV VSS_POSTGRESQL_HOST=postgres | ||
| #ENV VSS_POSTGRESQL_PORT=5432 | ||
| #ENV VSS_POSTGRESQL_DATABASE=postgres | ||
|
Comment on lines
+40
to
+42
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. These env vars don't exist yet, will be adding all of them in #73, would you mind holding on until that PR gets merged ? Should be soon |
||
|
|
||
| EXPOSE 8080 | ||
|
|
||
| # Run the server with the config file | ||
| CMD ["/app/vss-server", "/app/vss-server-config.toml"] | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not familiar with Docker, looked elsewhere sounds like we could replace all these lines with just
COPY . .?