Skip to content

Commit 0fd1351

Browse files
authored
ci: goodbye vercel (#529)
1 parent c06c9b5 commit 0fd1351

File tree

3 files changed

+77
-0
lines changed

3 files changed

+77
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Build Docker images
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout repository
12+
uses: actions/checkout@v4
13+
14+
- name: Log in to Docker Hub
15+
uses: docker/login-action@v2
16+
with:
17+
username: ${{ secrets.DOCKERHUB_USERNAME }}
18+
password: ${{ secrets.DOCKERHUB_TOKEN }}
19+
20+
- name: Build and push Docker image
21+
uses: docker/build-push-action@v4
22+
with:
23+
context: .
24+
file: ./Dockerfile
25+
push: true
26+
tags: |
27+
grizzlycodes/park-ui:latest

Dockerfile

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# syntax=docker/dockerfile:1.4
2+
3+
FROM oven/bun:1.3.3-alpine AS base
4+
WORKDIR /app
5+
6+
# Install dependencies with bun
7+
FROM base AS deps
8+
COPY package.json bun.lock* ./
9+
COPY website/package.json ./website/
10+
COPY components/react/package.json ./components/react/
11+
COPY packages/preset/package.json ./packages/preset/
12+
COPY packages/scripts/package.json ./packages/scripts/
13+
14+
RUN bun install --no-save --ignore-scripts
15+
16+
# Rebuild the source code only when needed
17+
FROM base AS builder
18+
WORKDIR /app
19+
COPY --from=deps /app/node_modules ./node_modules
20+
21+
COPY . .
22+
23+
ENV NEXT_TELEMETRY_DISABLED=1
24+
25+
RUN bun web prepare
26+
RUN bun web build
27+
28+
# Production image, copy all the files and run next
29+
FROM base AS runner
30+
WORKDIR /app
31+
32+
ENV NEXT_TELEMETRY_DISABLED=1
33+
ENV NODE_ENV=production \
34+
PORT=3000 \
35+
HOSTNAME="0.0.0.0"
36+
37+
RUN addgroup --system --gid 1001 nodejs && \
38+
adduser --system --uid 1001 nextjs
39+
40+
COPY --from=builder /app/website/public ./public
41+
42+
COPY --from=builder --chown=nextjs:nodejs /app/website/.next/standalone ./
43+
COPY --from=builder --chown=nextjs:nodejs /app/website/.next/static ./website/.next/static
44+
45+
USER nextjs
46+
47+
EXPOSE 3000
48+
49+
CMD ["bun", "./website/server.js"]

website/next.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const nextConfig: NextConfig = {
88
outputFileTracingIncludes: {
99
'/*': ['../components/*/src/**/*'],
1010
},
11+
output: 'standalone',
1112

1213
async redirects() {
1314
return [

0 commit comments

Comments
 (0)