cryptgeon/Dockerfile

30 lines
646 B
Docker
Raw Normal View History

# FRONTEND
FROM node:18-alpine as client
2021-05-02 11:53:48 +00:00
WORKDIR /tmp
RUN npm install -g pnpm@8
COPY . .
RUN pnpm install --frozen-lockfile
2021-11-11 12:37:21 +00:00
RUN pnpm run build
2021-05-02 11:53:48 +00:00
# BACKEND
FROM rust:1.69-alpine as backend
2021-05-02 11:53:48 +00:00
WORKDIR /tmp
RUN apk add libc-dev openssl-dev alpine-sdk
COPY ./packages/backend/Cargo.* ./
2023-05-25 22:21:50 +00:00
ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
RUN cargo fetch
COPY ./packages/backend ./
RUN cargo build --release
2021-05-02 11:53:48 +00:00
# RUNNER
FROM alpine
2021-05-02 11:53:48 +00:00
WORKDIR /app
COPY --from=backend /tmp/target/release/cryptgeon .
COPY --from=client /tmp/packages/frontend/build ./frontend
ENV FRONTEND_PATH="./frontend"
ENV REDIS="redis://redis/"
2023-01-13 18:36:26 +00:00
EXPOSE 8000
ENTRYPOINT [ "/app/cryptgeon" ]