Skip to content

Dockerfile #44

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
26 changes: 26 additions & 0 deletions Docker-composed.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: "3.8"
services:
backend:
build: ./server/
container-name: backend-container
ports:
-"4000:8000"
volumes:

- ./server:/app/backend/
- /app/backend/node_modules
depends_on:
- db

db:
image: mongo
container_name: database_container
environment:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DB name should be: mongodb://127.0.0.1:27017/ecommerce

And there are some other .env variables as well where are those?

- MONGO_URI=mongodb://mongo:27017/mern



volumes:
- mongo-data:/data/db


1 change: 1 addition & 0 deletions client/dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FROM
24 changes: 24 additions & 0 deletions server/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/charts
**/docker-compose*
**/compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
README.md
14 changes: 14 additions & 0 deletions server/dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM "node:21-alpine3.18"

WORKDIR /app/backend/

COPY package.json .


RUN npm install


CMD ["npm","run","start:dev"]