You've already forked AstralRinth
forked from didirus/AstralRinth
Switch to Postgres (#39)
* WIP Switch to Postgres * feat(postgres): more work on porting to postgres, now compiles * feat(docker-compose): Changed the docker-compose.yml file to use postgres. * Update docker, documentation, gh actions... * Remove bson dependency * Remove bson import * feat: move mock filehost to trait rather than cargo feature * feat(postgres): transactions for mod creation, multipart refactor * fix: Add Cargo.lock so that sqlx functions * Update sqlx offline build data * fix: Use SQLX_OFFLINE to force sqlx into offline mode for CI * Default release channels * feat(postgres): refactor database models to fit postgres models * fix: Fix sqlx prepare, fix double allocation in indexing * Add dockerfile (#40) Co-authored-by: Charalampos Fanoulis <charalampos.fanoulis@gmail.com> Co-authored-by: Aeledfyr <aeledfyr@gmail.com> Co-authored-by: redblueflame <contact@redblueflame.com> Co-authored-by: Jai A <jai.a@tuta.io> Co-authored-by: Valentin Ricard <redblueflame1@gmail.Com> Co-authored-by: Charalampos Fanoulis <charalampos.fanoulis@gmail.com>
This commit is contained in:
26
Dockerfile
Normal file
26
Dockerfile
Normal file
@@ -0,0 +1,26 @@
|
||||
FROM rust:1.43.1 as build
|
||||
ENV PKG_CONFIG_ALLOW_CROSS=1
|
||||
|
||||
WORKDIR /usr/src/labrinth
|
||||
# Download and compile deps
|
||||
COPY Cargo.toml .
|
||||
COPY Cargo.lock .
|
||||
COPY docker_utils/dummy.rs .
|
||||
# Change temporarely the path of the code
|
||||
RUN sed -i 's|src/main.rs|dummy.rs|' Cargo.toml
|
||||
# Build only deps
|
||||
RUN cargo build --release
|
||||
# Now return the file back to normal
|
||||
RUN sed -i 's|dummy.rs|src/main.rs|' Cargo.toml
|
||||
|
||||
# Copy everything
|
||||
COPY . .
|
||||
# Build our code
|
||||
ARG SQLX_OFFLINE=true
|
||||
RUN cargo build --release
|
||||
|
||||
|
||||
FROM gcr.io/distroless/cc-debian10
|
||||
COPY --from=build /usr/src/labrinth/target/release/labrinth /usr/local/bin/labrinth
|
||||
|
||||
CMD ["labrinth"]
|
||||
Reference in New Issue
Block a user