Skip to content

Commit

Permalink
Add .dockerignore and Dockerfile for server deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
OomsOoms committed Sep 29, 2024
1 parent ac1e7b6 commit 2e25b5b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
8 changes: 8 additions & 0 deletions server/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Ignore node_modules folder
node_modules
# Ignore logs
logs
# Ignore environment files
.env
# Ignore git directory
.git
20 changes: 20 additions & 0 deletions server/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Use the official Node.js image as the base image
FROM node:22.2.0-alpine

# Set the working directory
WORKDIR /app

# Copy package.json and package-lock.json
COPY package.json package-lock.json ./

# Install dependencies
RUN npm install --production

# Copy the rest of the application code
COPY . .

# Expose the port the app runs on
EXPOSE 3000

# Start the application, this uses cross-env to set the NODE_ENV to production
CMD ["npm", "run", "prod"]

0 comments on commit 2e25b5b

Please sign in to comment.