feat: server dockerfile
This commit is contained in:
23
Dockerfile.backend
Normal file
23
Dockerfile.backend
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
# Use node image
|
||||||
|
FROM node:18-alpine
|
||||||
|
|
||||||
|
# Set working directory in the container to /app
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Copy only the package.json and package-lock.json first for caching
|
||||||
|
COPY package.json package-lock.json ./
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
|
RUN npm install --production
|
||||||
|
|
||||||
|
# Copy the entire project (core and backend code)
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
# Set the working directory to the backend folder
|
||||||
|
WORKDIR /app/server
|
||||||
|
|
||||||
|
# Expose the port the backend listens on
|
||||||
|
EXPOSE 8080
|
||||||
|
|
||||||
|
# Start the backend server
|
||||||
|
CMD ["npm", "run", "start:server"]
|
||||||
Reference in New Issue
Block a user