Monorepo com apps/api (Go 1.23 + chi + pgx) e apps/web (Vue 3 + Vite + TypeScript). Dockerfile multi-stage consolida tudo em imagem única (~25MB) para deploy no Dokploy. Migrations rodando na inicialização; Vue embedado no binário Go via //go:embed. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
20 lines
318 B
Go
20 lines
318 B
Go
package migration
|
|
|
|
import (
|
|
"context"
|
|
_ "embed"
|
|
"fmt"
|
|
|
|
"github.com/jackc/pgx/v5/pgxpool"
|
|
)
|
|
|
|
//go:embed sql/001_initial.sql
|
|
var initial string
|
|
|
|
func Run(ctx context.Context, pool *pgxpool.Pool) error {
|
|
if _, err := pool.Exec(ctx, initial); err != nil {
|
|
return fmt.Errorf("001_initial: %w", err)
|
|
}
|
|
return nil
|
|
}
|