2022-06-07 10:29:40 +00:00
|
|
|
# FRONTEND
|
|
|
|
FROM node:16-alpine as client
|
2021-05-02 11:53:48 +00:00
|
|
|
WORKDIR /tmp
|
2022-07-16 12:16:54 +00:00
|
|
|
RUN npm install -g pnpm@7
|
2022-10-07 19:28:25 +00:00
|
|
|
COPY ./packages/frontend ./
|
2021-11-11 12:37:21 +00:00
|
|
|
RUN pnpm install
|
2022-07-19 08:27:23 +00:00
|
|
|
RUN pnpm exec svelte-kit sync
|
2021-11-11 12:37:21 +00:00
|
|
|
RUN pnpm run build
|
2021-05-02 11:53:48 +00:00
|
|
|
|
|
|
|
|
2022-06-07 10:29:40 +00:00
|
|
|
# BACKEND
|
|
|
|
FROM rust:1.61-alpine as backend
|
2021-05-02 11:53:48 +00:00
|
|
|
WORKDIR /tmp
|
|
|
|
RUN apk add libc-dev openssl-dev alpine-sdk
|
2022-10-07 19:28:25 +00:00
|
|
|
COPY ./packages/backend/Cargo.* ./
|
2022-07-19 19:55:05 +00:00
|
|
|
RUN cargo fetch
|
2022-10-07 19:28:25 +00:00
|
|
|
COPY ./packages/backend ./
|
2021-05-02 11:53:48 +00:00
|
|
|
RUN cargo build --release
|
|
|
|
|
|
|
|
|
2022-06-07 10:29:40 +00:00
|
|
|
# RUNNER
|
|
|
|
FROM alpine
|
2021-05-02 11:53:48 +00:00
|
|
|
WORKDIR /app
|
2022-06-07 10:29:40 +00:00
|
|
|
COPY --from=backend /tmp/target/release/cryptgeon .
|
2022-07-19 19:55:05 +00:00
|
|
|
COPY --from=client /tmp/build ./frontend
|
|
|
|
ENV FRONTEND_PATH="./frontend"
|
|
|
|
ENV REDIS="redis://redis/"
|
2021-05-08 08:16:05 +00:00
|
|
|
EXPOSE 5000
|
2022-07-16 12:16:54 +00:00
|
|
|
ENTRYPOINT [ "/app/cryptgeon" ]
|