Skip to content

Commit

Permalink
👷 ci: update dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
megasanjay committed Dec 9, 2024
1 parent c0b0540 commit fd0b979
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
24 changes: 23 additions & 1 deletion .github/workflows/deploy-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,4 +202,26 @@ jobs:

# Deploy the app for all other times
- run: kamal redeploy
# - run: kamal redeploy --verbose
# - run: kamal redeploy --verbose

migrate-db:
runs-on: ubuntu-latest
environment: stg
defaults:
run:
working-directory: ui
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}

steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: 20

- run: yarn install

- run: yarn prisma:generate

- run: yarn prisma:migrate:deploy
4 changes: 2 additions & 2 deletions ui/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ RUN apk add --no-cache openssl
WORKDIR /app

# Copy only the necessary files from builder stage
COPY --from=builder /app/package.json ./
# COPY --from=builder /app/package.json ./
COPY --from=builder /app/.output ./
COPY --from=builder /app/node_modules/.prisma ./node_modules/.prisma
COPY --from=builder /app/node_modules/@prisma ./node_modules/@prisma

# Create startup script that runs migrations before starting the app
RUN echo '#!/bin/sh' > /app/start.sh && \
echo 'npm run prisma:migrate:deploy' >> /app/start.sh && \
# echo 'npm run prisma:migrate:deploy' >> /app/start.sh && \
echo 'exec node /app/server/index.mjs' >> /app/start.sh && \
chmod +x /app/start.sh

Expand Down

0 comments on commit fd0b979

Please sign in to comment.