2024-11-13 08:23:22 -06:00
|
|
|
# Stage: monolith-builder
|
|
|
|
# Purpose: Uses the Rust image to build monolith
|
|
|
|
# Notes:
|
|
|
|
# - Fine to leave extra here, as only the resulting binary is copied out
|
|
|
|
FROM docker.io/rust:1.80-bullseye AS monolith-builder
|
|
|
|
|
|
|
|
RUN set -eux && cargo install --locked monolith
|
|
|
|
|
|
|
|
# Stage: main-app
|
|
|
|
# Purpose: Compiles the frontend and
|
|
|
|
# Notes:
|
|
|
|
# - Nothing extra should be left here. All commands should cleanup
|
|
|
|
FROM node:18.18-bullseye-slim AS main-app
|
2023-08-02 18:52:37 -05:00
|
|
|
|
2023-09-19 14:41:40 -05:00
|
|
|
ARG DEBIAN_FRONTEND=noninteractive
|
2023-08-02 18:52:37 -05:00
|
|
|
|
|
|
|
RUN mkdir /data
|
|
|
|
|
|
|
|
WORKDIR /data
|
|
|
|
|
2023-08-03 16:54:04 -05:00
|
|
|
COPY ./package.json ./yarn.lock ./playwright.config.ts ./
|
2023-08-02 18:52:37 -05:00
|
|
|
|
2024-11-13 08:23:22 -06:00
|
|
|
RUN --mount=type=cache,sharing=locked,target=/usr/local/share/.cache/yarn \
|
|
|
|
set -eux && \
|
|
|
|
yarn install --network-timeout 10000000
|
2024-07-13 17:13:32 -05:00
|
|
|
|
2024-11-13 08:23:22 -06:00
|
|
|
# Copy the compiled monolith binary from the builder stage
|
|
|
|
COPY --from=monolith-builder /usr/local/cargo/bin/monolith /usr/local/bin/monolith
|
2024-07-13 17:13:32 -05:00
|
|
|
|
2024-11-13 08:23:22 -06:00
|
|
|
RUN set -eux && \
|
|
|
|
npx playwright install --with-deps chromium && \
|
2023-10-20 22:58:38 -05:00
|
|
|
apt-get clean && \
|
2024-07-13 17:13:32 -05:00
|
|
|
yarn cache clean
|
|
|
|
|
2023-08-02 18:52:37 -05:00
|
|
|
COPY . .
|
|
|
|
|
2024-11-12 22:58:50 -06:00
|
|
|
RUN yarn prisma generate && \
|
|
|
|
yarn build
|
|
|
|
|
2024-08-16 20:56:00 -05:00
|
|
|
EXPOSE 3000
|
|
|
|
|
2024-11-13 08:23:22 -06:00
|
|
|
CMD yarn prisma migrate deploy && yarn start
|