cryptgeon/Dockerfile

33 lines
765 B
Docker
Raw Normal View History

# FRONTEND
FROM node:16-alpine as client
2021-05-02 11:53:48 +00:00
WORKDIR /tmp
RUN npm install -g pnpm@7
COPY ./packages/frontend ./
2021-11-11 12:37:21 +00:00
RUN pnpm install
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
# BACKEND
2022-11-02 12:24:30 +00:00
FROM rust:1.64-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.* ./
2022-11-02 12:24:30 +00: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
COPY ./packages/backend ./
2022-11-02 12:24:30 +00:00
RUN cargo +nightly 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/build ./frontend
ENV FRONTEND_PATH="./frontend"
ENV REDIS="redis://redis/"
2021-05-08 08:16:05 +00:00
EXPOSE 5000
ENTRYPOINT [ "/app/cryptgeon" ]