Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

👷 ci: fix staging deploys #104

Merged
merged 7 commits into from
Nov 15, 2024
Merged
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
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"]
Loading