2022-06-07 12:29:40 +02:00
|
|
|
# FRONTEND
|
|
|
|
FROM node:16-alpine as client
|
2021-05-02 13:53:48 +02:00
|
|
|
WORKDIR /tmp
|
2022-07-16 14:16:54 +02:00
|
|
|
RUN npm install -g pnpm@7
|
2022-10-07 21:28:25 +02:00
|
|
|
COPY ./packages/frontend ./
|
2021-11-11 13:37:21 +01:00
|
|
|
RUN pnpm install
|
2022-07-19 10:27:23 +02:00
|
|
|
RUN pnpm exec svelte-kit sync
|
2021-11-11 13:37:21 +01:00
|
|
|
RUN pnpm run build
|
2021-05-02 13:53:48 +02:00
|
|
|
|
|
|
|
|
2022-06-07 12:29:40 +02:00
|
|
|
# BACKEND
|
2022-11-02 13:24:30 +01:00
|
|
|
FROM rust:1.64-alpine as backend
|
2021-05-02 13:53:48 +02:00
|
|
|
WORKDIR /tmp
|
|
|
|
RUN apk add libc-dev openssl-dev alpine-sdk
|
2022-10-07 21:28:25 +02:00
|
|
|
COPY ./packages/backend/Cargo.* ./
|
2022-11-02 13:24:30 +01:00
|
|
|
# https://blog.rust-lang.org/2022/06/22/sparse-registry-testing.html
|
|
|
|
RUN rustup update nightly
|
|
|
|
ENV CARGO_UNSTABLE_SPARSE_REGISTRY=true
|
|
|
|
RUN cargo +nightly fetch
|
2022-10-07 21:28:25 +02:00
|
|
|
COPY ./packages/backend ./
|
2022-11-02 13:24:30 +01:00
|
|
|
RUN cargo +nightly build --release
|
2021-05-02 13:53:48 +02:00
|
|
|
|
|
|
|
|
2022-06-07 12:29:40 +02:00
|
|
|
# RUNNER
|
|
|
|
FROM alpine
|
2021-05-02 13:53:48 +02:00
|
|
|
WORKDIR /app
|
2022-06-07 12:29:40 +02:00
|
|
|
COPY --from=backend /tmp/target/release/cryptgeon .
|
2022-07-19 21:55:05 +02:00
|
|
|
COPY --from=client /tmp/build ./frontend
|
|
|
|
ENV FRONTEND_PATH="./frontend"
|
|
|
|
ENV REDIS="redis://redis/"
|
2023-01-13 19:36:26 +01:00
|
|
|
EXPOSE 8000
|
2022-07-16 14:16:54 +02:00
|
|
|
ENTRYPOINT [ "/app/cryptgeon" ]
|