Skip to content

Commit

Permalink
Merge pull request #571 from haseebzaki-07/new_branch
Browse files Browse the repository at this point in the history
Add docker compose file to the root of the project
  • Loading branch information
akbatra567 authored Aug 8, 2024
2 parents 02b35f9 + 400a71f commit e773f81
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 0 deletions.
7 changes: 7 additions & 0 deletions admin/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM node:alpine
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm install
COPY . .
EXPOSE 5173
CMD ["npm", "run" , "dev"]
10 changes: 10 additions & 0 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM node:alpine
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm install
COPY . .
RUN npm run backend-build


EXPOSE 8000
CMD ["npm", "run" , "dev"]
40 changes: 40 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@

services:

admin:
build:
context: ./admin
container_name: styleshare-admin
ports:
- '5173:5173'

frontend:
build:
context: ./frontend
container_name: styleshare-frontend
ports:
- '3000:3000'

backend:
build:
context: ./backend
container_name: styleshare-backend
depends_on:
- db
environment:
- DATABASE_URL=${DATABASE_URL}

ports:
- '8000:8000'

db:
image: mongo:latest
container_name: styleshare-db
restart: always
ports:
- '27017:27017'
volumes:
- mongodb_data:/data/db

volumes:
mongodb_data:
7 changes: 7 additions & 0 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM node:alpine
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm install
COPY . .
EXPOSE 3000
CMD ["npm", "run" , "dev"]

0 comments on commit e773f81

Please sign in to comment.