Skip to content

Commit

Permalink
Merge pull request #896 from NUTFes/fix/hikahana/convert-opai-codegen
Browse files Browse the repository at this point in the history
oapi-codegenの導入
  • Loading branch information
Kubosaka authored Dec 25, 2024
2 parents 6e721d4 + 867af22 commit 50d4302
Show file tree
Hide file tree
Showing 18 changed files with 6,073 additions and 3,188 deletions.
31 changes: 21 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@ build:

# アプリコンテナの起動
run:
docker compose up
docker compose up -d

# アプリコンテナの停止
down:
docker compose down

# dbコンテナの起動(基本ずっと起動しておく)
run-db:
docker compose -f docker-compose.db.yml up -d
docker compose -f compose.db.yml up -d

# dbコンテナの停止(ずっと起動したくない時はこっちで停止)
stop-db:
docker compose -f docker-compose.db.yml down
docker compose -f compose.db.yml down

# ビルドと起動
build-run:
docker compose -f docker-compose.db.yml up -d
docker compose -f compose.db.yml up -d
docker compose up --build

# アプリコンテナボリュームの削除
Expand All @@ -32,7 +32,7 @@ del-vol:

# 生成したコンテナ、イメージ、ボリューム、ネットワークを一括削除
del-all:
docker-compose down --rmi all --volumes --remove-orphans
compose down --rmi all --volumes --remove-orphans

# ボリューム削除→ビルド→起動
run-rebuild:
Expand All @@ -41,7 +41,7 @@ run-rebuild:

# dbとminioの停止とボリューム削除(dbを初期化したい時)
del-db:
docker-compose -f docker-compose.db.yml down --volumes
compose -f compose.db.yml down --volumes

# apiの起動(db起動後)
run-api:
Expand All @@ -57,13 +57,13 @@ seed:

# 本番環境デプロイ
deploy:
docker compose -f docker-compose.prod.yml build
docker compose -f docker-compose.prod.yml up -d
docker compose -f compose.prod.yml build
docker compose -f compose.prod.yml up -d

# ローカルで本番設定で起動
run-prod:
docker compose -f docker-compose.local-prod.yml build
docker compose -f docker-compose.local-prod.yml up
docker compose -f compose.local-prod.yml build
docker compose -f compose.local-prod.yml up

# DB入るコマンド
ent-db:
Expand All @@ -72,3 +72,14 @@ ent-db:
# eslintの実行
run-eslint:
docker compose exec view npm run lint

generate-openapi:
docker compose run --rm api oapi-codegen -config /openapi/config.yaml /openapi/openapi.yaml

run-swagger:
docker compose -f compose.swagger.yml up -d

run-all:
make run-db
make run
make run-swagger
3 changes: 1 addition & 2 deletions api/dev.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ ENV CGO_ENABLED=0
ENV GOOS=linux
#ENV GOARCH=amd64

# swaggerをinstall
RUN go install github.com/swaggo/swag/cmd/swag@latest
RUN go install github.com/deepmap/oapi-codegen/v2/cmd/[email protected]

# Airをインストール
RUN go install github.com/air-verse/air@latest
Expand Down
Loading

0 comments on commit 50d4302

Please sign in to comment.