-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (25 loc) · 819 Bytes
/
Dockerfile
File metadata and controls
28 lines (25 loc) · 819 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# syntax=docker/dockerfile:1
FROM node:22-alpine AS web
WORKDIR /app
COPY client/package.json client/package-lock.json ./
RUN npm ci
COPY client/ ./
RUN npm run build
FROM rust:1.85-bookworm AS rust
WORKDIR /app
COPY server/Cargo.toml server/Cargo.lock ./
COPY server/migrations ./migrations
COPY server/src ./src
RUN cargo build --release
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --from=rust /app/target/release/io3233-server /app/io3233-server
COPY --from=web /app/dist /app/static
ENV STATIC_DIR=/app/static
ENV DATABASE_URL=sqlite:/app/data/data.db?mode=rwc
ENV BIND=0.0.0.0:3233
EXPOSE 3233
VOLUME ["/app/data"]
ENTRYPOINT ["/bin/sh", "-c", "mkdir -p /app/data && exec /app/io3233-server"]