Added redis
This commit is contained in:
parent
12283640fe
commit
0a629bf80f
10
Dockerfile
10
Dockerfile
@ -1,6 +1,9 @@
|
|||||||
# Use the official Node.js 22.4.1 image
|
# Use the official Node.js 22.4.1 image
|
||||||
FROM node:22.4.1-alpine
|
FROM node:22.4.1-alpine
|
||||||
|
|
||||||
|
# Install Redis
|
||||||
|
RUN apk add --no-cache redis
|
||||||
|
|
||||||
# Set the working directory in the container
|
# Set the working directory in the container
|
||||||
WORKDIR /usr/src/
|
WORKDIR /usr/src/
|
||||||
|
|
||||||
@ -22,11 +25,12 @@ COPY . .
|
|||||||
# Build the application
|
# Build the application
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
# Expose the port your Node.js application will listen on
|
# Expose the ports your Node.js application and Redis will listen on
|
||||||
EXPOSE 80
|
EXPOSE 80 6379
|
||||||
|
|
||||||
# Create a shell script to run migrations and start the application
|
# Create a shell script to run Redis, run migrations, and start the application
|
||||||
RUN echo '#!/bin/sh' > /usr/src/start.sh && \
|
RUN echo '#!/bin/sh' > /usr/src/start.sh && \
|
||||||
|
echo 'redis-server --daemonize yes' >> /usr/src/start.sh && \
|
||||||
echo 'npx prisma migrate deploy' >> /usr/src/start.sh && \
|
echo 'npx prisma migrate deploy' >> /usr/src/start.sh && \
|
||||||
echo 'node dist/server.js' >> /usr/src/start.sh && \
|
echo 'node dist/server.js' >> /usr/src/start.sh && \
|
||||||
chmod +x /usr/src/start.sh
|
chmod +x /usr/src/start.sh
|
||||||
|
Loading…
x
Reference in New Issue
Block a user