-
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.
Merge pull request #30 from curieo-org/docker-fixes
Docker fixes
- Loading branch information
Showing
7 changed files
with
257 additions
and
14 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,17 @@ | ||
name: Build Docker Image | ||
|
||
on: | ||
push: | ||
branches: | ||
- docker-fixes | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build Docker Image | ||
run: docker build -t curieo/search-rustserver:latest server/ |
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
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
72 changes: 72 additions & 0 deletions
72
server/.sqlx/query-29ef534c8dec3b0822559ee28a5301acd854ff1669e6b6a70c81fd50c952e998.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
74 changes: 74 additions & 0 deletions
74
server/.sqlx/query-a101d3708b8506c9af02ee42596fe07202b5c5f4de22a80fd504364c130cb496.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
72 changes: 72 additions & 0 deletions
72
server/.sqlx/query-a3300cb44e90f76b4f9acefc227fc8a0a8686a250812fe534bce9bd610c15867.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,27 +1,38 @@ | ||
FROM lukemathwalker/cargo-chef:latest-rust-1.77-slim-bookworm as chef | ||
WORKDIR /app | ||
FROM rust:1.77 AS planner | ||
WORKDIR app | ||
|
||
FROM chef AS planner | ||
RUN cargo install cargo-chef | ||
COPY . . | ||
RUN cargo chef prepare --recipe-path recipe.json | ||
RUN cargo chef prepare --recipe-path recipe.json | ||
|
||
FROM chef AS builder | ||
RUN apt-get update -y && apt-get install -y make perl | ||
FROM rust:1.77 AS cacher | ||
WORKDIR app | ||
RUN cargo install cargo-chef | ||
COPY --from=planner /app/recipe.json recipe.json | ||
# Build our project dependencies, not our application! | ||
RUN cargo chef cook --release --recipe-path recipe.json | ||
|
||
FROM rust:1.77 AS builder | ||
WORKDIR app | ||
COPY --from=cacher /app/target target | ||
COPY --from=cacher /usr/local/cargo /usr/local/cargo | ||
COPY . . | ||
ENV SQLX_OFFLINE true | ||
RUN cargo build --release --bin server | ||
|
||
FROM debian:bookworm-slim AS runtime | ||
WORKDIR /app | ||
WORKDIR app | ||
COPY config config | ||
COPY --from=builder /app/target/release/server /usr/local/bin | ||
COPY ./config ./config | ||
RUN apt-get update -y \ | ||
&& apt-get install -y --no-install-recommends openssl \ | ||
# Clean up | ||
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* | ||
|
||
RUN useradd -u 1000 server | ||
|
||
USER server | ||
|
||
EXPOSE 3030 | ||
|
||
CMD ["server"] | ||
ENTRYPOINT ["/usr/local/bin/server"] |