-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
27 lines (23 loc) · 736 Bytes
/
Dockerfile
File metadata and controls
27 lines (23 loc) · 736 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
# Base builder
FROM rust:1.75 as builder
WORKDIR /app
COPY . .
# Server builder
FROM builder as server-builder
RUN cargo build --release -p fullrstack-server
# Web builder
FROM builder as web-builder
RUN cargo build --release -p fullrstack-web
RUN cargo install trunk
RUN cd crates/web && trunk build --release
# Server runtime
FROM debian:bookworm-slim as server
RUN apt-get update && apt-get install -y libssl-dev ca-certificates
COPY --from=server-builder /app/target/release/fullrstack-server /usr/local/bin/
EXPOSE 8080 9090
CMD ["fullrstack-server"]
# Web runtime
FROM nginx:alpine as web
COPY --from=web-builder /app/crates/web/dist /usr/share/nginx/html
COPY deployment/nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 3000