2025-02-14 14:29:50 +01:00
|
|
|
# Paraglide doesn't properly work with Bun, so it needs Node
|
2025-05-01 02:17:55 +02:00
|
|
|
FROM imbios/bun-node:latest-current-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
|
2025-01-29 04:42:34 +01:00
|
|
|
COPY package.json bun.lock /temp/dev/
|
2024-12-08 18:36:41 +01:00
|
|
|
COPY project.inlang /temp/dev/project.inlang
|
2024-12-07 18:34:09 +01:00
|
|
|
RUN cd /temp/dev && bun install --frozen-lockfile
|
2024-04-15 03:16:57 +02:00
|
|
|
|
|
|
|
|
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-11-05 14:25:28 +01:00
|
|
|
RUN cd /app && bun run emojis:generate
|
2024-12-07 14:53:00 +01:00
|
|
|
RUN cd /app && bun run build
|
2024-04-15 03:16:57 +02:00
|
|
|
|
2024-12-07 14:53:00 +01:00
|
|
|
# Run final web server
|
|
|
|
|
FROM ghcr.io/static-web-server/static-web-server:2-alpine AS final
|
2024-04-15 03:16:57 +02:00
|
|
|
|
2024-12-07 14:53:00 +01:00
|
|
|
COPY --from=builder /app/.output/public /app/public
|
|
|
|
|
COPY sws.toml /etc/config.toml
|
2024-04-15 03:16:57 +02:00
|
|
|
|
2025-02-05 19:48:27 +01:00
|
|
|
LABEL org.opencontainers.image.authors="Versia contributors (https://forge.versia.pub/versia-pub/frontend/graph)"
|
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-12-07 14:53:00 +01:00
|
|
|
EXPOSE 3000
|
2025-01-29 04:42:34 +01:00
|
|
|
CMD ["static-web-server", "--config-file", "/etc/config.toml"]
|