Improved folder structures for better maintainability
This commit is contained in:
12
Dockerfile
12
Dockerfile
@ -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"]
|
Reference in New Issue
Block a user