Skip to content

Commit

Permalink
👷 ci: fix staging deploys (#104)
Browse files Browse the repository at this point in the history
  • Loading branch information
megasanjay authored Nov 15, 2024
1 parent 262b983 commit 764f2e1
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions ui/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,9 @@ ARG DATABASE_URL
COPY package.json yarn.lock ./
COPY prisma ./prisma/

# Install dependencies and generate prisma client
RUN yarn install --frozen-lockfile
RUN yarn prisma:generate
RUN yarn prisma:migrate:deploy
RUN yarn cache clean

# RUN yarn install --frozen-lockfile --production \
# && yarn prisma:generate \
# && yarn prisma:migrate:deploy \
# && yarn cache clean
RUN yarn install --frozen-lockfile \
&& yarn prisma:generate \
&& yarn cache clean

# Copy source files and build
COPY . .
Expand All @@ -43,6 +36,12 @@ 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 'yarn prisma:migrate deploy' >> /app/start.sh && \
echo 'exec node /app/server/index.mjs' >> /app/start.sh && \
chmod +x /app/start.sh

EXPOSE 3000

CMD ["node", "/app/server/index.mjs"]
CMD ["/bin/sh", "/app/start.sh"]

0 comments on commit 764f2e1

Please sign in to comment.