forked from verse-pbc/groups_relay
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.dev
More file actions
73 lines (57 loc) · 1.69 KB
/
Copy pathDockerfile.dev
File metadata and controls
73 lines (57 loc) · 1.69 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
FROM rust:1.87.0-slim-bookworm AS rust-builder
RUN set -eux; \
apt-get update -y; \
apt-get install -y --no-install-recommends \
pkg-config \
libssl-dev \
ca-certificates \
make; \
rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*; \
apt-get clean
WORKDIR /usr/src/app
# Copy project files
COPY .cargo/config.toml .cargo/config.toml
COPY Cargo.toml Cargo.lock ./
COPY src ./src
COPY benches ./benches
# Build the relay binary in debug mode with tokio-console support
ENV RUSTFLAGS="--cfg tokio_unstable"
RUN cargo build --features console
FROM node:20-slim AS frontend-builder
WORKDIR /usr/src/app/frontend
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
python3 \
make \
g++; \
rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*; \
apt-get clean; \
npm install -g pnpm
COPY frontend/package*.json ./
COPY frontend/pnpm-lock.yaml ./
RUN pnpm install
COPY frontend/src ./src
COPY frontend/index.html ./
COPY frontend/vite.config.mts ./
COPY frontend/tsconfig.json ./
COPY frontend/postcss.config.cjs ./
COPY frontend/tailwind.config.js ./
RUN pnpm run build
FROM debian:bookworm-slim
RUN set -eux; \
apt-get update -y; \
apt-get install -y --no-install-recommends \
ca-certificates \
libssl3 \
iputils-ping \
curl; \
rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*; \
apt-get clean
WORKDIR /app
COPY config/settings.yml ./config/
COPY --from=rust-builder /usr/src/app/target/debug/groups_relay ./groups_relay
COPY --from=frontend-builder /usr/src/app/frontend/dist ./frontend/dist
EXPOSE 8080
EXPOSE 6669
CMD ["./groups_relay"]