Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docker compose file to the root of the project #571

Merged
merged 5 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"]
Loading