From 6465b1c833755f81453ecaa2b8e2e18b868d986c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Quentin=20Guid=C3=A9e?= Date: Sun, 3 Mar 2024 13:56:56 -0500 Subject: [PATCH] hot reload server MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Quentin Guidée --- docker/docker-compose.dev.yml | 16 ++++++++++------ server/docker/bundle.dev.Dockerfile | 15 +++++++++++++++ 2 files changed, 25 insertions(+), 6 deletions(-) create mode 100644 server/docker/bundle.dev.Dockerfile diff --git a/docker/docker-compose.dev.yml b/docker/docker-compose.dev.yml index b36ff398..6e30f683 100644 --- a/docker/docker-compose.dev.yml +++ b/docker/docker-compose.dev.yml @@ -14,13 +14,17 @@ services: vertex: build: context: ../server - dockerfile: docker/bundle.Dockerfile - args: - - APP_KIND=main + dockerfile: docker/bundle.dev.Dockerfile + environment: + - APP_KIND=main + volumes: + - ../server:/build/server vertex-kernel: build: context: ../server - dockerfile: docker/bundle.Dockerfile - args: - - APP_KIND=kernel + dockerfile: docker/bundle.dev.Dockerfile + environment: + - APP_KIND=kernel + volumes: + - ../server:/build/server diff --git a/server/docker/bundle.dev.Dockerfile b/server/docker/bundle.dev.Dockerfile new file mode 100644 index 00000000..b40e3bcd --- /dev/null +++ b/server/docker/bundle.dev.Dockerfile @@ -0,0 +1,15 @@ +FROM --platform=$BUILDPLATFORM golang:1.21-alpine AS build-stage + +WORKDIR /build + +COPY . . + +RUN apk add --no-cache git + +RUN go install -mod=mod github.com/githubnemo/CompileDaemon + +ARG APP_KIND=main + +EXPOSE 80 7500 7502 7504 7505 7506 7508 7510 7512 7514 7516 7518 + +ENTRYPOINT CompileDaemon -build='go build ./cmd/'"$APP_KIND" -directory=.