Skip to content

Commit a29bc27

Browse files
FarewellFarewell
authored andcommitted
Switch to production Dockerfile.server with PostgreSQL support
- CI workflow now uses Dockerfile.server instead of standalone Dockerfile - Added prisma migrate deploy to CMD for auto-migration on startup - Added --network-timeout 600000 for arm64 QEMU builds - Changed exposed port to 3005
1 parent 2526a4c commit a29bc27

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

.github/workflows/build-server.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
paths:
77
- 'packages/happy-server/**'
88
- 'packages/happy-wire/**'
9-
- 'Dockerfile'
9+
- 'Dockerfile.server'
1010
- '.github/workflows/build-server.yml'
1111
workflow_dispatch:
1212

@@ -51,7 +51,7 @@ jobs:
5151
uses: docker/build-push-action@v6
5252
with:
5353
context: .
54-
file: Dockerfile
54+
file: Dockerfile.server
5555
platforms: linux/amd64,linux/arm64
5656
push: true
5757
tags: ${{ steps.meta.outputs.tags }}

Dockerfile.server

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ COPY packages/happy-server/prisma packages/happy-server/prisma
2222
COPY packages/happy-cli/scripts packages/happy-cli/scripts
2323
COPY packages/happy-cli/tools packages/happy-cli/tools
2424

25-
RUN SKIP_HAPPY_WIRE_BUILD=1 yarn install --frozen-lockfile --ignore-engines
25+
RUN SKIP_HAPPY_WIRE_BUILD=1 yarn install --frozen-lockfile --ignore-engines --network-timeout 600000
2626

2727
# Stage 2: build the server
2828
FROM deps AS builder
@@ -49,8 +49,6 @@ COPY --from=builder /repo/node_modules /repo/node_modules
4949
COPY --from=builder /repo/packages/happy-wire /repo/packages/happy-wire
5050
COPY --from=builder /repo/packages/happy-server /repo/packages/happy-server
5151

52-
# Expose the port the app will run on
53-
EXPOSE 3000
52+
EXPOSE 3005
5453

55-
# Command to run the application
56-
CMD ["yarn", "--cwd", "packages/happy-server", "start"]
54+
CMD ["sh", "-c", "cd packages/happy-server && npx prisma migrate deploy && exec yarn start"]

0 commit comments

Comments
 (0)