Something went wrong. Try again.
Bring your e-reader into the Atmosphere headway.page
Something went wrong. Try again.
headway-page Dockerfile
1.1 kB · 38 lines
Dockerfile
at main
123456789101112131415161718192021222324252627282930313233343536373839# ---- build stage ----FROM rust:1-slim AS builder
RUN apt-get update && apt-get install -y --no-install-recommends \ libsqlite3-dev pkg-config \ && rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Cache dependency compilation separately from source changes.# migrations/ is needed because sqlx::migrate!() embeds them at compile time.COPY Cargo.toml Cargo.lock ./COPY migrations/ migrations/RUN mkdir src src/bin \ && echo 'fn main() {}' > src/main.rs \ && echo 'fn main() {}' > src/bin/seed_user.rs \ && echo 'fn main() {}' > src/bin/gen_key.rs \ && cargo build --release --bin headway-page \ && rm -rf src
COPY src/ src/RUN find src -name "*.rs" | xargs touch && cargo build --release --bin headway-page
# ---- runtime stage ----FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y --no-install-recommends \ libsqlite3-0 ca-certificates \ && rm -rf /var/lib/apt/lists/*
RUN mkdir -p /dataWORKDIR /appCOPY --from=builder /app/target/release/headway-page .
ENV PORT=3000EXPOSE 3000
CMD ["./headway-page"]