mirror of
https://github.com/PCSX2/web-api.git
synced 2026-01-31 01:15:16 +01:00
* workers: init * workers: d1 initial work * workers: resuming work, simplified schema * api: flesh out the majority of critical features * api: get rid of the old implementation * db: seed database with current releases * db: break seed files up, too much for a single stdout buffer * api: support version diff'ing * d1: debugging insert issue * api: fix insert issue (missing `await`s) and explicitly cache to avoid invocations * api: append CORS headers for requests originating from `pcsx2.net` * api: update seed data and fix response data * api: optimize DB indexes and add caching * api: update page rule cache when a release is added/deleted/modified * api: most functionality ported over to rocket.rs * api: finish off core implementation * api: dockerize * api: cleaning up TODOs * v1: remove some of the old implementation * v2: small script to pull release data, update DB seed * v2: minor cleanup * v2: finalize v1 -> v2 transition * v2: synchronize db on startup * sqlx: commit sql query metadata * v2: handful of bug fixes and v1 parity adjustments * v2: some repo house cleaning * ci: add CI workflows * ci: finalize ci implementation
37 lines
866 B
Docker
37 lines
866 B
Docker
FROM rust:1.81-slim-bullseye as base
|
|
|
|
RUN apt-get update
|
|
RUN apt-get install -y libssl-dev pkg-config
|
|
|
|
FROM base as builder
|
|
|
|
WORKDIR /usr/src/pcsx2-api
|
|
COPY . .
|
|
|
|
# SQLX prep
|
|
RUN cargo install sqlx-cli
|
|
ENV DATABASE_URL="sqlite://db.sqlite3"
|
|
RUN sqlx database create
|
|
RUN sqlx migrate run --source ./db/migrations
|
|
RUN cargo sqlx prepare
|
|
|
|
# Build the binary
|
|
RUN cargo install --path .
|
|
RUN chmod +x ./target/release/pcsx2-api
|
|
|
|
FROM debian:bullseye-slim as final
|
|
|
|
RUN mkdir /app && chown nobody:nogroup /app && chmod 700 /app
|
|
# Install latest package updates
|
|
RUN apt update -y && apt upgrade -y
|
|
# Install CA Certificates
|
|
RUN apt-get install -y ca-certificates && update-ca-certificates
|
|
# Copy in Binary
|
|
COPY --from=builder /usr/src/pcsx2-api/target/release/pcsx2-api /app/pcsx2-api
|
|
|
|
# Run container as non-root user
|
|
USER nobody
|
|
WORKDIR /app
|
|
|
|
ENTRYPOINT ["/app/pcsx2-api"]
|