Skip to content

Commit

Permalink
update docker
Browse files Browse the repository at this point in the history
  • Loading branch information
mohit-nagaraj committed Sep 24, 2024
1 parent 96426c9 commit f5f3cd4
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 5 deletions.
16 changes: 14 additions & 2 deletions server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,24 @@ ENV PORT=${PORT}
ENV MONGO_URI=${MONGO_URI}
ENV JWT_KEY=${JWT_KEY}

# Create app directory
WORKDIR /usr/src/app

# Copy SSL certificates to the correct path
COPY ssl/server.key ./ssl/server.key
COPY ssl/server.cert ./ssl/server.cert

# Copy package.json and package-lock.json first to leverage Docker caching
COPY package*.json ./

# Install app dependencies
RUN npm install

# Copy app source code
COPY . .

EXPOSE 5000
# Expose the port your app runs on
EXPOSE 433

CMD ["npm", "start"]
# Command to run your app
CMD ["npm", "start"]
18 changes: 15 additions & 3 deletions socket/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
FROM node:22-alpine
FROM node:22-alpine

# Set the working directory
WORKDIR /usr/src/app

# Copy package.json and package-lock.json first to leverage Docker caching
COPY package*.json ./

# Install app dependencies
RUN npm install

# Copy the SSL certificates into the image
COPY ssl/server.key ./ssl/server.key
COPY ssl/server.cert ./ssl/server.cert

# Copy the rest of the application source code
COPY . .

EXPOSE 3000
# Expose the port your app runs on (3000 in this case)
EXPOSE 3000

CMD ["npm", "start"]
# Command to run your app
CMD ["npm", "start"]

0 comments on commit f5f3cd4

Please sign in to comment.