cryptgeon/Dockerfile
2023-08-14 10:12:26 +02:00

31 lines
681 B
Docker

# FRONTEND
FROM node:18-alpine as client
WORKDIR /tmp
RUN npm install -g pnpm@8
COPY . .
RUN pnpm install --frozen-lockfile
RUN pnpm run build
# BACKEND
FROM rust:1.71-alpine as backend
WORKDIR /tmp
RUN apk add libc-dev openssl-dev alpine-sdk
# COPY ./packages/backend/Cargo.* ./
# ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
# RUN cargo fetch
COPY ./packages/backend ./
RUN cargo build --release
# RUNNER
FROM alpine
WORKDIR /app
RUN apk add --no-cache curl
COPY --from=backend /tmp/target/release/cryptgeon .
COPY --from=client /tmp/packages/frontend/build ./frontend
ENV FRONTEND_PATH="./frontend"
ENV REDIS="redis://redis/"
EXPOSE 8000
ENTRYPOINT [ "/app/cryptgeon" ]