-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
chore: GitHub Actions の修正
- Loading branch information
Showing
4 changed files
with
33 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
app.yaml | ||
cloud-run-service.template.yaml | ||
Dockerfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# ビルドステージ | ||
FROM golang:1.23 AS builder | ||
|
||
# 作業ディレクトリの設定 | ||
WORKDIR /backend | ||
|
||
# Goモジュールをキャッシュ | ||
COPY go.mod . | ||
COPY go.sum . | ||
RUN go mod download | ||
|
||
# アプリケーションのソースをコピー | ||
COPY . . | ||
|
||
# アプリケーションをビルド | ||
RUN go build -o main main.go | ||
|
||
# 実行ステージ | ||
FROM debian:stable-slim | ||
|
||
WORKDIR /app | ||
|
||
# なぜか path を通さないとエラーになった | ||
ENV PATH="/app:${PATH}" | ||
|
||
# ビルド済みのバイナリをコピー | ||
COPY --from=builder /backend/main /app/main | ||
|
||
CMD ["./main"] |