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 live-reload for development with docker #323

Open
wants to merge 1 commit into
base: main
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
1 change: 1 addition & 0 deletions apps/web/backend/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
6 changes: 6 additions & 0 deletions apps/web/backend/backend_dev.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM node:14-alpine3.15
COPY . /back
WORKDIR /back
ENV DB="mongodb"
RUN npm install && npm install nodemon
ENTRYPOINT ["npx", "nodemon"]
27 changes: 27 additions & 0 deletions apps/web/docker-compose-dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
services:
mongodb:
image: mongo:5.0.2
ports:
- "27017:27017"
container_name: mongodb
restart: always
backend:
build:
context: backend
dockerfile: backend_dev.Dockerfile
volumes:
- type: bind
source: ./backend
target: /back
depends_on:
- mongodb
frontend:
ports:
- "3000:3000"
build:
context: frontend
dockerfile: frontend_dev.Dockerfile
volumes:
- type: bind
source: ./frontend
target: /front
1 change: 1 addition & 0 deletions apps/web/frontend/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
5 changes: 5 additions & 0 deletions apps/web/frontend/frontend_dev.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM node:14-alpine3.15
COPY . /front
WORKDIR /front
RUN npm i && npm i nodemon
ENTRYPOINT ["npx", "nodemon"]
Loading