-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
36 lines (27 loc) · 852 Bytes
/
Dockerfile
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
29
30
31
32
33
34
35
36
# syntax = docker/dockerfile:1
FROM rust:1.80-slim AS rustbase
WORKDIR /app
FROM node:20-bookworm-slim AS nodebase
WORKDIR /app
FROM nodebase AS frontend-builder
WORKDIR /app
COPY package.json ./package.json
COPY frontend/package.json ./frontend/package.json
COPY yarn.lock ./yarn.lock
RUN yarn install --frozen-lockfile
COPY frontend ./
RUN yarn build
FROM rustbase AS backend-builder
COPY Cargo.lock .
COPY Cargo.toml .
COPY migration migration
COPY backend backend
COPY --from=frontend-builder /app/dist /app/frontend/dist
RUN cargo build --release
FROM debian:bookworm-slim AS runtime
RUN addgroup --system --gid 1001 chamsae
RUN adduser --system --uid 1001 chamsae
USER chamsae
COPY --from=backend-builder /app/target/release/chamsae /usr/local/bin
COPY --from=backend-builder /app/target/release/migration /usr/local/bin
CMD ["chamsae"]