forked from
lewis.moe/bspds-sandbox
PDS software with bells & whistles you didn’t even know you needed. will move this to its own account when ready.
1FROM denoland/deno:alpine AS frontend-builder
2WORKDIR /frontend
3COPY frontend/ ./
4RUN deno task build
5
6FROM rust:1.92-alpine AS builder
7RUN apk add ca-certificates openssl openssl-dev openssl-libs-static pkgconfig musl-dev
8WORKDIR /app
9COPY Cargo.toml Cargo.lock ./
10COPY src ./src
11COPY tests ./tests
12COPY migrations ./migrations
13COPY .sqlx ./.sqlx
14RUN --mount=type=cache,target=/usr/local/cargo/registry \
15 --mount=type=cache,target=/app/target \
16 cargo build --release && \
17 cp target/release/tranquil-pds /tmp/tranquil-pds
18
19FROM alpine:3.23
20RUN apk add --no-cache msmtp ca-certificates && ln -sf /usr/bin/msmtp /usr/sbin/sendmail
21COPY --from=builder /tmp/tranquil-pds /usr/local/bin/tranquil-pds
22COPY --from=builder /app/migrations /app/migrations
23COPY --from=frontend-builder /frontend/dist /app/frontend/dist
24WORKDIR /app
25ENV SERVER_HOST=0.0.0.0
26ENV SERVER_PORT=3000
27ENV FRONTEND_DIR=/app/frontend/dist
28EXPOSE 3000
29CMD ["tranquil-pds"]