2024-08-19 22:24:10 +02:00
|
|
|
FROM imbios/bun-node:22-alpine AS base
|
2024-04-15 03:16:57 +02:00
|
|
|
|
|
|
|
|
# Install dependencies into temp directory
|
|
|
|
|
# This will cache them and speed up future builds
|
|
|
|
|
FROM base AS install
|
2024-06-20 04:31:09 +02:00
|
|
|
|
2024-04-15 03:16:57 +02:00
|
|
|
RUN mkdir -p /temp/dev
|
|
|
|
|
COPY package.json bun.lockb /temp/dev/
|
|
|
|
|
RUN cd /temp/dev && bun install --frozen-lockfile
|
|
|
|
|
|
|
|
|
|
FROM base AS builder
|
|
|
|
|
|
2024-06-20 04:31:09 +02:00
|
|
|
COPY . /app
|
2024-04-15 03:16:57 +02:00
|
|
|
COPY --from=install /temp/dev/node_modules /app/node_modules
|
2024-06-20 04:47:17 +02:00
|
|
|
RUN cd /app && bun run build --preset node-server
|
2024-04-15 03:16:57 +02:00
|
|
|
|
2024-11-04 15:23:28 +01:00
|
|
|
FROM oven/bun:1.1.34-alpine AS final
|
2024-04-15 03:16:57 +02:00
|
|
|
|
|
|
|
|
COPY --from=builder /app/.output/ /app
|
|
|
|
|
|
2024-08-19 22:24:10 +02:00
|
|
|
LABEL org.opencontainers.image.authors="Gaspard Wierzbinski (https://cpluspatch.com)"
|
2024-08-28 00:23:29 +02:00
|
|
|
LABEL org.opencontainers.image.source="https://github.com/versia-pub/frontend"
|
|
|
|
|
LABEL org.opencontainers.image.vendor="Versia"
|
2024-08-19 22:24:10 +02:00
|
|
|
LABEL org.opencontainers.image.licenses="AGPL-3.0"
|
2024-08-28 00:23:29 +02:00
|
|
|
LABEL org.opencontainers.image.title="Versia-FE"
|
|
|
|
|
LABEL org.opencontainers.image.description="Frontend for the Versia Server Project"
|
2024-04-15 03:16:57 +02:00
|
|
|
|
2024-04-22 10:10:14 +02:00
|
|
|
WORKDIR /app
|
2024-08-19 22:24:10 +02:00
|
|
|
CMD ["bun", "run", "server/index.mjs"]
|