Skip to content

Commit

Permalink
fix: Update Dockerfiles to use Alpine base image
Browse files Browse the repository at this point in the history
  • Loading branch information
peterxcli committed Feb 18, 2024
1 parent 4b9a850 commit 9b2b6b8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Dockerfile_Backend
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Build Stage
FROM golang:1.21 AS build

FROM golang:1.21-alpine AS build
RUN apk add --no-cache git
# Set the working directory
WORKDIR /app

Expand All @@ -14,7 +14,7 @@ RUN go mod download
# ENV CGO_ENABLED=1

# Build the Go application
RUN CGO_ENABLED=1 GOOS=linux go build -o /app/main ./cmd/backend/main.go
RUN go build -o /app/main ./cmd/backend/main.go

# Runtime Stage
FROM alpine:latest AS runtime
Expand Down
5 changes: 3 additions & 2 deletions Dockerfile_Notifier
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Build Stage
FROM golang:1.21 AS build
FROM golang:1.21-alpine AS build
RUN apk add --no-cache git

# Set the working directory
WORKDIR /app
Expand All @@ -14,7 +15,7 @@ RUN go mod download
# ENV CGO_ENABLED=1

# Build the Go application
RUN CGO_ENABLED=1 GOOS=linux go build -o /app/main ./cmd/notifier/main.go
RUN go build -o /app/main ./cmd/notifier/main.go

# Runtime Stage
FROM alpine:latest AS runtime
Expand Down

0 comments on commit 9b2b6b8

Please sign in to comment.