Merge pull request 'Added .env file to docker build' (#6) from dev into main
This commit was merged in pull request #6.
This commit is contained in:
@@ -0,0 +1,2 @@
|
|||||||
|
DTTMR_OTLP_ENDPOINT=172.17.0.1:4317
|
||||||
|
DTTMR_DATABASE_URL=postgres://postgres:postgres@172.17.0.1:5432/postgres?sslmode=disable&timezone=utc
|
||||||
+3
-1
@@ -5,7 +5,8 @@ COPY go.mod go.sum ./
|
|||||||
|
|
||||||
RUN go mod download
|
RUN go mod download
|
||||||
|
|
||||||
COPY . .
|
COPY "./internal" "./internal"
|
||||||
|
COPY "./cmd" "./cmd"
|
||||||
|
|
||||||
RUN go build -o ./server github.com/robindittmar/dttmr-api/cmd/api-server
|
RUN go build -o ./server github.com/robindittmar/dttmr-api/cmd/api-server
|
||||||
|
|
||||||
@@ -13,6 +14,7 @@ FROM debian:latest
|
|||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY .env.docker .env
|
||||||
COPY --from=build /app/server /app/server
|
COPY --from=build /app/server /app/server
|
||||||
|
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ func run(serviceName string, serviceVersion string) error {
|
|||||||
setupLogging()
|
setupLogging()
|
||||||
|
|
||||||
slog.Info("starting service", slog.String("service", serviceName), slog.String("version", serviceVersion))
|
slog.Info("starting service", slog.String("service", serviceName), slog.String("version", serviceVersion))
|
||||||
|
defer slog.Info("service shutdown!")
|
||||||
|
|
||||||
cfg := config.Load()
|
cfg := config.Load()
|
||||||
|
|
||||||
@@ -97,7 +98,6 @@ func run(serviceName string, serviceVersion string) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
slog.Info("service shutdown successful!")
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user