fix(frontend): .env reaches the build for $env/static, the runtime image stays without it; eslint + prettier as an alternative to biome; image named with dashes
This commit is contained in:
1 parent
180f16defd
commit
c93a8fc68d
16 files changed
+136
-15
No files matched your search
@@ -1,20 +1,41 @@
|
||||
{% if frontend_adapter == 'bun' -%}
|
||||
FROM oven/bun:alpine
|
||||
FROM oven/bun:alpine AS deps
|
||||
|
||||
ENV TERM=xterm-256color
|
||||
ENV COLORTERM=truecolor
|
||||
ENV BUN_INSTALL_CACHE_DIR=/bun-cache
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package.json bun.lock* ./
|
||||
|
||||
RUN bun install --frozen-lockfile
|
||||
RUN --mount=type=cache,target=/bun-cache bun install --frozen-lockfile
|
||||
|
||||
|
||||
# .env is in the context ($env/static/* are inlined at build) and stays in
|
||||
# this stage: the runtime image below gets build/ and production deps only.
|
||||
FROM deps AS builder
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN bun --bun svelte-kit sync
|
||||
RUN bun --bun run build
|
||||
|
||||
|
||||
FROM oven/bun:alpine AS runtime
|
||||
|
||||
ENV NODE_ENV=production
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package.json bun.lock* ./
|
||||
|
||||
RUN --mount=type=cache,target=/bun-cache,env=BUN_INSTALL_CACHE_DIR bun install --frozen-lockfile --production
|
||||
|
||||
COPY --from=builder /app/build ./build
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
ENTRYPOINT ["bun"]
|
||||
CMD ["build/index.js"]
|
||||
{%- else -%}
|
||||
|
||||
Reference in new issue
Block a user