You've already forked golang-saas-starter-kit
mirror of
https://github.com/raseels-repos/golang-saas-starter-kit.git
synced 2025-06-29 00:52:03 +02:00
issue#19 recompile service on file change
Updated web-app and web-api to auto build the service when running with docker-compose.
This commit is contained in:
@ -13,8 +13,9 @@ ENV GO111MODULE="on"
|
||||
COPY go.mod .
|
||||
COPY go.sum .
|
||||
RUN go mod download
|
||||
RUN go get github.com/pilu/fresh
|
||||
|
||||
FROM build_base_golang AS builder
|
||||
FROM build_base_golang AS dev
|
||||
|
||||
ARG service
|
||||
ARG commit_ref=-
|
||||
@ -23,15 +24,20 @@ ARG commit_ref=-
|
||||
COPY internal ./internal
|
||||
|
||||
# Copy cmd specific packages.
|
||||
COPY cmd/${service} ./cmd/web-app
|
||||
COPY cmd/${service} ./cmd/${service}
|
||||
COPY cmd/${service}/templates /templates
|
||||
COPY cmd/${service}/static /static
|
||||
|
||||
# Copy the global templates.
|
||||
ADD resources/templates/shared /templates/shared
|
||||
ADD fresh-auto-reload.conf /runner.conf
|
||||
|
||||
WORKDIR ./cmd/${service}
|
||||
|
||||
ENTRYPOINT ["fresh", "-c", "/runner.conf"]
|
||||
|
||||
FROM dev AS builder
|
||||
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags "-X main.build=${commit_ref}" -a -installsuffix nocgo -o /gosrv .
|
||||
|
||||
FROM alpine:3.9
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
{{end}}
|
||||
{{define "content"}}
|
||||
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="/account">Account</a></li>
|
||||
|
Reference in New Issue
Block a user