-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor Dockerfile using alpine image; * introduce SQLite, remove redis; * introduce sqlx, without compile time guarantees on queries; * replace cached with mini-moka cache. More granular, cached structs and not function calls and returns; * remove unused parameters in router (sort, order) to avoid useless caching. Add cache for runtime fields values; * update README.md; * chore: order creature list by name by default.
- Loading branch information
Showing
19 changed files
with
350 additions
and
479 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
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,26 +1,43 @@ | ||
# Stage 1: Build the Rust project | ||
FROM rust:latest as builder | ||
FROM rust:1.73-alpine as builder | ||
|
||
# Set the working directory in the container | ||
WORKDIR /app | ||
|
||
# Copy the project files into the container | ||
COPY . . | ||
|
||
# Install all the required libraries | ||
# GCC | ||
RUN apk add build-base | ||
|
||
RUN apk add musl-dev | ||
RUN cargo install cross | ||
|
||
# cross needs docker to work | ||
RUN apk add --update docker openrc | ||
RUN rc-update add docker boot | ||
|
||
# Static binary magic | ||
#RUN rustup target add aarch64-unknown-linux-musl | ||
#RUN rustup toolchain install stable-aarch64-unknown-linux-musl | ||
|
||
# Build the project with optimizations | ||
RUN cargo build --release | ||
RUN cargo build --target x86_64-unknown-linux-musl --release | ||
|
||
# Stage 2: Create a minimal runtime image | ||
FROM debian:bookworm-slim | ||
FROM alpine:latest | ||
|
||
# Adding sqlite, cannot do it before | ||
RUN apk add sqlite | ||
|
||
# Set the working directory in the container | ||
WORKDIR /app | ||
|
||
# Copy the built binary from the previous stage | ||
COPY --from=builder /app/target/release/bybe . | ||
COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/bybe . | ||
|
||
# Expose the port that your Actix-Web application will listen on | ||
EXPOSE 25566 | ||
|
||
# Command to run your application when the container starts | ||
CMD ["./bybe"] | ||
ENTRYPOINT ["./bybe"] |
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
Oops, something went wrong.