Skip to content

Commit

Permalink
Merge pull request #87 from swisstopo/feature/asset-73-ci-cd-for-data…
Browse files Browse the repository at this point in the history
…base-changes

Feature 73: CI/CD for Database Changes
  • Loading branch information
daniel-va authored Apr 24, 2024
2 parents 0d177b0 + 5d39259 commit 64ced24
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
9 changes: 8 additions & 1 deletion apps/server-asset-sg/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM node:20-alpine as api-builder

ENV NODE_ENV=development

WORKDIR /app
COPY . .

Expand All @@ -10,8 +12,13 @@ RUN npx nx build server-asset-sg
# final image build
FROM node:20-alpine

ENV NODE_ENV=production

WORKDIR /app
COPY --from=api-builder /app/dist/apps/server-asset-sg .
COPY --from=api-builder /app/node_modules ./node_modules
COPY apps/server-asset-sg/docker/start.sh start.sh
RUN chmod +x start.sh

CMD ["node", "main.js"]
ENTRYPOINT ["sh"]
CMD ["start.sh"]
4 changes: 4 additions & 0 deletions apps/server-asset-sg/docker/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

npx prisma migrate deploy || exit 1
node main.js

0 comments on commit 64ced24

Please sign in to comment.