Skip to content
This repository was archived by the owner on Sep 11, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
Dockerfile
39 changes: 39 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,42 @@ jobs:
name: playwright-report
path: playwright-report/
retention-days: 30

container:
name: Container
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- run: docker build -t blocks:test .

- name: run and check
run: |
docker run -d --name blocks -p 3000:3000 blocks:test

# Wait for container to be ready (up to 30 seconds)
echo "Waiting for container to start..."
for i in {1..30}; do
if curl -f -s http://localhost:3000 > /dev/null 2>&1; then
echo "Container is ready!"
break
fi
echo "Attempt $i/30: Container not ready yet, waiting..."
sleep 1
done

- name: health check
run: |
echo "Checking health..."
RESP="$(curl -Ss http://localhost:3000/health)"
if test "$RESP" != "OK"; then
printf "Health check failed! Here's what we got:\n\n%s\n\n" "$RESP"
exit 1
fi
echo "Health check passed!"

- name: stop container
if: always()
run: |
echo "Stopping Docker container..."
docker stop blocks || true
docker rm blocks || true
29 changes: 29 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FROM node:24 AS build

RUN npm install -g pnpm

ENV NODE_ENV=production

# Install deps
COPY package.json pnpm-lock.yaml /app/
WORKDIR /app
RUN pnpm install

# Build the app
COPY . /app
RUN pnpm run build

# Prepare production image
FROM node:24 AS run

ENV NODE_ENV=production

RUN npm install -g pnpm

COPY package.json pnpm-lock.yaml /app/
WORKDIR /app
RUN pnpm install --production

COPY --from=build /app/build /app
WORKDIR /app
CMD ["node", "index.js"]
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"@lucide/svelte": "0.542.0",
"@oddbird/css-anchor-positioning": "0.6.1",
"@playwright/test": "1.55.0",
"@sveltejs/adapter-auto": "6.1.0",
"@sveltejs/adapter-node": "5.3.1",
"@sveltejs/kit": "2.37.0",
"@sveltejs/vite-plugin-svelte": "6.1.4",
"@testing-library/svelte": "5.2.8",
Expand Down
Loading
Loading