Improved folder structures for better maintainability

This commit is contained in:
2024-07-21 20:20:06 +02:00
parent 88820178cf
commit 62b9b4ec5c
50 changed files with 24 additions and 29 deletions

View File

@ -2,7 +2,7 @@
FROM node:22.4.1-alpine
# Set the working directory in the container
WORKDIR /usr/src/app
WORKDIR /usr/src/
# Copy package.json and package-lock.json (if available)
COPY package*.json ./
@ -26,10 +26,10 @@ RUN npm run build
EXPOSE 80
# Create a shell script to run migrations and start the application
RUN echo '#!/bin/sh' > /usr/src/app/start.sh && \
echo 'npx prisma migrate deploy' >> /usr/src/app/start.sh && \
echo 'node dist/server.js' >> /usr/src/app/start.sh && \
chmod +x /usr/src/app/start.sh
RUN echo '#!/bin/sh' > /usr/src/start.sh && \
echo 'npx prisma migrate deploy' >> /usr/src/start.sh && \
echo 'node dist/server.js' >> /usr/src/start.sh && \
chmod +x /usr/src/start.sh
# Use the shell script as the entry point
CMD ["/usr/src/app/start.sh"]
CMD ["/usr/src/start.sh"]