cryptgeon/Dockerfile

30 lines
632 B
Docker
Raw Normal View History

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