Added .env file to docker build #6
@@ -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
|
||||
|
||||
COPY . .
|
||||
COPY "./internal" "./internal"
|
||||
COPY "./cmd" "./cmd"
|
||||
|
||||
RUN go build -o ./server github.com/robindittmar/dttmr-api/cmd/api-server
|
||||
|
||||
@@ -13,6 +14,7 @@ FROM debian:latest
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY .env.docker .env
|
||||
COPY --from=build /app/server /app/server
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
@@ -36,6 +36,7 @@ func run(serviceName string, serviceVersion string) error {
|
||||
setupLogging()
|
||||
|
||||
slog.Info("starting service", slog.String("service", serviceName), slog.String("version", serviceVersion))
|
||||
defer slog.Info("service shutdown!")
|
||||
|
||||
cfg := config.Load()
|
||||
|
||||
@@ -97,7 +98,6 @@ func run(serviceName string, serviceVersion string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
slog.Info("service shutdown successful!")
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user