diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..3ac080a Binary files /dev/null and b/.DS_Store differ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1c17a28 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +# Use the official Node.js image +FROM node:18-alpine + +# Set the working directory inside the container +WORKDIR /app + +# Copy package.json and package-lock.json +COPY package*.json ./ + +# Install dependencies +RUN npm install + +# Copy the rest of the application files +COPY . . + +# Expose the application port +EXPOSE 5000 + +# Start the application +CMD ["node", "server.js"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..af0bc1e --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,25 @@ +version: '3.8' + +services: + app: + build: + context: . + dockerfile: Dockerfile + ports: + - "5001:5000" # Map host port 5001 to container port 5000 + environment: + - PORT=5000 + - MONGO_URI=mongodb://db:27017/aitend-database # MongoDB connection string + depends_on: + - db # Wait for the database service to start + + db: + image: mongo:6 + container_name: mongodb + ports: + - "27017:27017" # Expose MongoDB's default port + volumes: + - mongo-data:/data/db # Persist MongoDB data + +volumes: + mongo-data: \ No newline at end of file