-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathContainerfile
More file actions
35 lines (27 loc) · 841 Bytes
/
Containerfile
File metadata and controls
35 lines (27 loc) · 841 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
29
30
31
32
33
34
35
# builder base image
FROM rust:1.85-alpine3.21 AS builder
# add required packages
RUN apk add --no-cache \
npm pkgconfig openssl-dev openssl-libs-static zlib build-base
# create the app directory and copy in source
RUN mkdir -p /app/target/web
COPY frontend/ /app/frontend
COPY backend/ /app/backend
# build the svelte frontend
WORKDIR /app/frontend
RUN npm i; npm run build
RUN cp -r /app/frontend/build/* /app/target/web/
# build the rust backend
WORKDIR /app/backend
RUN cargo build --release
RUN cp /app/backend/target/release/hyde-backend /app/target/hyde
# runtime container
FROM alpine:latest AS runtime
# add required runtime packages
RUN apk add --no-cache libgcc
# copy in built files from builder
RUN mkdir -p /app/hyde-data/
WORKDIR /app
COPY --from=builder /app/target/ /app
# run the stuff
ENTRYPOINT ["/app/hyde"]