diff --git a/Makefile b/Makefile index 290b3ae..b303f28 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,10 @@ stop: @echo "Stopping server and db..." @docker-compose down +watch: start + @echo "Watching for file changes..." + @docker-compose watch + restart: stop start logs: diff --git a/docker-compose.yml b/docker-compose.yml index 67c8b1e..653927d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,19 +1,25 @@ version: "3.8" services: - app: + server: build: dockerfile: Dockerfile context: . ports: - "80:8080" - volumes: - - .:/app environment: - REDIS_ADDRESS=db:6379 - REDIS_PASSWORD=secret - REDIS_DB=0 depends_on: - db + develop: + watch: + - action: rebuild + files: + - ./**/*.go + - ./go.mod + - ./go.sum + db: image: redis:7.2.1-alpine restart: always