diff --git a/.dockerignore b/.dockerignore index 4eed4d4..1cc91bb 100644 --- a/.dockerignore +++ b/.dockerignore @@ -5,9 +5,6 @@ yarn-debug.log* yarn-error.log* # Development files -src/ -index.html -vite.config.js *.md .git/ .gitignore @@ -45,3 +42,6 @@ logs # Other coverage/ .nyc_output/ + +# Built files (will be built inside Docker) +dist/ diff --git a/.forgejo/workflows/build-and-dockerise.yml b/.forgejo/workflows/build-and-dockerise.yml index c4bd873..3a5c6b4 100644 --- a/.forgejo/workflows/build-and-dockerise.yml +++ b/.forgejo/workflows/build-and-dockerise.yml @@ -26,19 +26,6 @@ jobs: with: fetch-depth: 0 # Recommended for metadata action - - name: Setup Bun - uses: oven-sh/setup-bun@v2 - with: - bun-version: latest - - - name: Install dependencies - run: bun install - shell: sh - - - name: Build project - run: bun run build - shell: sh - - name: Set up Docker Buildx id: buildx uses: docker/setup-buildx-action@v3 diff --git a/Dockerfile b/Dockerfile index 3b99d41..9d9bb8e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,10 +9,10 @@ COPY package.json bun.lock* ./ # Install all dependencies (including devDependencies for building) RUN bun install --frozen-lockfile -# Copy source code +# Copy source code and configuration files COPY . . -# Build the application +# Build the application with Vite RUN bun run build # Production stage @@ -26,7 +26,7 @@ COPY package.json bun.lock* ./ # Install only production dependencies RUN bun install --frozen-lockfile --production -# Copy built application and server +# Copy built application and server from build stage COPY --from=builder /app/dist ./dist COPY src/server.ts ./src/server.ts