chore: prepare docker container for prisma database
This commit is contained in:
parent
29e7d47546
commit
904547b50f
3 changed files with 18 additions and 1 deletions
|
@ -1,2 +1,7 @@
|
||||||
.next
|
.next
|
||||||
node_modules
|
node_modules
|
||||||
|
prisma/*.db*
|
||||||
|
data
|
||||||
|
README.md
|
||||||
|
*.env*
|
||||||
|
.yarn
|
||||||
|
|
|
@ -22,6 +22,8 @@ FROM base AS runner
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
RUN yarn add prisma -D
|
||||||
|
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
ENV NEXT_TELEMETRY_DISABLED=1
|
ENV NEXT_TELEMETRY_DISABLED=1
|
||||||
|
|
||||||
|
@ -36,4 +38,4 @@ LABEL org.opencontainers.image.description="A web application for managing meetu
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
|
||||||
ENV HOSTNAME="0.0.0.0"
|
ENV HOSTNAME="0.0.0.0"
|
||||||
CMD ["server.js"]
|
CMD ["/bin/ash", "entrypoint.sh"]
|
||||||
|
|
10
entrypoint.sh
Executable file
10
entrypoint.sh
Executable file
|
@ -0,0 +1,10 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
echo "Running start script with user $(whoami) and NODE_ENV $NODE_ENV"
|
||||||
|
if [ "$NODE_ENV" == "production" ]; then
|
||||||
|
if [ -d "prisma/migrations" ]; then
|
||||||
|
echo "Running Prisma migrations"
|
||||||
|
npx prisma migrate deploy
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
exec node server.js
|
Loading…
Add table
Add a link
Reference in a new issue