feat: Add Docker configuration files
Add .dockerignore, Dockerfile, and docker-compose.yml files to configure Docker for the project.
This commit is contained in:
parent
1988673f80
commit
3301b365f9
5
.dockerignore
Normal file
5
.dockerignore
Normal file
@ -0,0 +1,5 @@
|
||||
node_modules
|
||||
dist
|
||||
*.log
|
||||
*.md
|
||||
.git
|
26
Dockerfile
Normal file
26
Dockerfile
Normal file
@ -0,0 +1,26 @@
|
||||
# Use the official Node.js image as the base image
|
||||
FROM node:20
|
||||
|
||||
# Set the working directory inside the container
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
# Copy package.json and package-lock.json to the working directory
|
||||
COPY package*.json ./
|
||||
|
||||
# Install the application dependencies
|
||||
RUN yarn install
|
||||
|
||||
# Copy the rest of the application files
|
||||
COPY . .
|
||||
|
||||
# Generate Prisma client
|
||||
RUN yarn prisma generate
|
||||
|
||||
# Build the NestJS application
|
||||
RUN yarn build
|
||||
|
||||
# Expose the application port
|
||||
EXPOSE 3000
|
||||
|
||||
# Command to run the application
|
||||
CMD ["node", "dist/main"]
|
5
docker-compose.yml
Normal file
5
docker-compose.yml
Normal file
@ -0,0 +1,5 @@
|
||||
services:
|
||||
api:
|
||||
image: toogether/api
|
||||
ports:
|
||||
- "3000:3000"
|
Loading…
Reference in New Issue
Block a user