Open IslamZaoui opened 1 month ago
Could you share the dockerfile you used for this? I can't reproduce this at the moment
I delete the code from my repo but here is what I wrote in that docker file:
FROM alpine:latest as downloader
ARG VERSION=0.19.4
ARG ARCH=linux_amd64
RUN wget https://github.com/pocketbase/pocketbase/releases/download/v${VERSION}/pocketbase_${VERSION}_${ARCH}.zip \
&& unzip pocketbase_${VERSION}_${ARCH}.zip -d /tmp/ \
&& chmod +x /tmp/pocketbase
FROM alpine:latest as base
WORKDIR /app
RUN apk update && apk add ca-certificates && rm -rf /var/cache/apk/*
COPY --from=downloader /tmp/pocketbase /app/pocketbase
EXPOSE 8090
CMD ["./pocketbase", "serve", "--http=0.0.0.0:8090"]
FROM oven/bun:1.0 as frontend
WORKDIR /app
COPY ./ ./
RUN bun install
RUN bun run build
FROM base as prod
COPY ./pocketbase/pb_hooks /app/pb_hooks
COPY ./pocketbase/pb_migrations /app/pb_migrations
COPY --from=frontend /app/build /app/pb_public
The error occurs after install
Also have this issue. Here is my Dockerfile
# syntax = docker/dockerfile:1
# Adjust BUN_VERSION as desired
ARG BUN_VERSION=1.1.8
FROM oven/bun:${BUN_VERSION}-slim as base
LABEL fly_launch_runtime="SvelteKit"
# SvelteKit app lives here
WORKDIR /app
# Set production environment
ENV NODE_ENV="production"
# Throw-away build stage to reduce size of final image
FROM base as build
# Install packages needed to build node modules
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y build-essential pkg-config python-is-python3
# Install node modules
COPY --link bun.lockb package.json ./
RUN bun install
# Copy application code
COPY --link . .
# Build application
RUN bun --bun run build
# Remove development dependencies
RUN rm -rf node_modules && \
bun install --ci
# Final stage for app image
FROM base
# Copy built application
COPY --from=build /app/build /app/build
COPY --from=build /app/node_modules /app/node_modules
COPY --from=build /app/package.json /app
# Start the server by default, this can be overwritten at runtime
EXPOSE 3000
CMD [ "bun", "run", "start" ]
And here's the error I get
Everyone seems to be using bun
which also doesn't run properly outside of a docker file. Does the issue still occur if you use node
?
Everyone seems to be using
bun
which also doesn't run properly outside of a docker file. Does the issue still occur if you usenode
?
Yes the issue also exists when using a node runtime as well.
@dihmeetree can you try without the --link ?
I can only reproduce this when using bun
in order to install or build. The following docker file using node
directly works as expected with a SvelteKit project.
# Use the official Node.js image as a base image
FROM node:18
WORKDIR /app
COPY . .
RUN npm install
RUN npm run build
CMD ["npm", "run", "preview"]
I can only reproduce this when using
bun
in order to install or build. The following docker file usingnode
directly works as expected with a SvelteKit project.# Use the official Node.js image as a base image FROM node:18 WORKDIR /app COPY . . RUN npm install RUN npm run build CMD ["npm", "run", "preview"]
Thanks Loris.. gave Node another shot. It does indeed work. I maybe have been misconfiguring the Dockerfile so it couldn't find the ./project.inlang
folder. Here's the final Dockerfile I ended up using for SvelteKit
FROM node:18-alpine AS builder
WORKDIR /app
COPY package*.json ./project.inlang .
RUN apk add --no-cache curl
RUN npm ci
COPY . .
RUN npm run build
RUN npm prune --production
FROM node:18-alpine
WORKDIR /app
COPY --from=builder /app/build build/
COPY --from=builder /app/node_modules node_modules/
COPY package.json .
EXPOSE 3000
ENV NODE_ENV=production
CMD [ "node", "build" ]
Hello, Im currently facing this issue in my sveltekit project
github repo of my project