Skip to content

Commit

Permalink
chore: adds live reload services
Browse files Browse the repository at this point in the history
  • Loading branch information
cristianoliveira committed Sep 2, 2023
1 parent a224272 commit e3151ed
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 7 deletions.
12 changes: 9 additions & 3 deletions .watch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,16 @@
#
# list here all the events and the commands that it should execute

- name: restart main app
run: 'docker compose restart web'
change: ['app/**/*', 'nginx/default.conf', 'docker-compose.yml']
ignore: ['services/**/*']

- name: restart todos-app
run: 'docker compose restart todos-app'
change: 'services/todos/**/*'

# - name: restart todos-app
# run: 'docker compose restart todos-app'
# change: 'services/two/**/*'
- name: restart chat-app
run: 'docker-compose up --detach --build'
change: 'services/chat/**/*'
ignore: [ 'services/chat/target/**/*' ]
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM nginx

# COPY app /usr/share/nginx/html
COPY ./nginx /etc/nginx/conf.d/
14 changes: 12 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,22 @@ start:
@echo "Starting the services..."
@docker compose up

.phony: rebuild-start
rebuild-start:
@echo "rebuilding the services..."
@docker compose up --build

.Phony: build
build:
@echo "Starting the services..."
@echo "Building the services..."
@docker compose build

.PHONY: watch
watch:
@echo "Watching the application..."
@funzzy
@funzzy --config=.watch.yaml

.PHONY: kill
kill:
@echo "Killing all applications..."
@docker compose kill
8 changes: 7 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,17 @@ services:

volumes:
- ./app:/usr/share/nginx/html
- ./nginx:/etc/nginx/conf.d/

todos-app:
build: services/todos
ports:
- "4001:4001" # Web Server
volumes:
- ./services/todos:/app

chat-app:
build: services/chat
ports:
- "4002:4002" # Web Server
# volumes:
# - ./services/chat:/app

0 comments on commit e3151ed

Please sign in to comment.