-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
692f117
commit 08e1dc7
Showing
3 changed files
with
79 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# docker-compose.yml | ||
|
||
version: '3.8' | ||
|
||
services: | ||
backend: | ||
build: | ||
context: ./backend | ||
dockerfile: Dockerfile | ||
container_name: backend | ||
ports: | ||
- "8080:8080" | ||
depends_on: | ||
- mongo | ||
|
||
frontend: | ||
build: | ||
context: ./frontend | ||
dockerfile: Dockerfile | ||
container_name: frontend | ||
ports: | ||
- "5173:5173" | ||
depends_on: | ||
- backend | ||
|
||
mongo: | ||
image: mongo:6 | ||
container_name: mongo | ||
ports: | ||
- "27017:27017" | ||
volumes: | ||
- mongo-data:/data/db | ||
|
||
volumes: | ||
mongo-data: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# backend/Dockerfile | ||
|
||
# Base image for Node | ||
FROM node:18 | ||
|
||
# Set the working directory | ||
WORKDIR /app | ||
|
||
# Copy package.json and package-lock.json | ||
COPY package*.json ./ | ||
|
||
# Install dependencies | ||
RUN npm install | ||
|
||
# Copy the rest of the application code | ||
COPY . . | ||
|
||
# Expose port 5000 for the backend | ||
EXPOSE 5000 | ||
|
||
# Start the backend with npm run dev | ||
CMD ["npm", "run", "dev"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# frontend/Dockerfile | ||
|
||
# Base image for Node | ||
FROM node:18 | ||
|
||
# Set the working directory | ||
WORKDIR /app | ||
|
||
# Copy package.json and package-lock.json | ||
COPY package*.json ./ | ||
|
||
# Install dependencies | ||
RUN npm install | ||
|
||
# Copy the rest of the application code | ||
COPY . . | ||
|
||
# Expose port 3000 for the frontend | ||
EXPOSE 5173 | ||
|
||
# Start the frontend with npm run dev | ||
CMD ["npm", "run", "dev", "--", "--host"] |