refactor: reorganize project structure and update configurations

- Move migrations/ to database/schema/ for clarity on database schema definitions
- Move sqlc.yaml to internal/database/ to group with database code
- Move static/ to cmd/server/static/ to co-locate with server
- Update all configuration files and documentation
- Follow Go project conventions for better organization
This commit is contained in:
2026-01-24 23:40:31 -05:00
parent 8a951fb242
commit 08e80ae84b
34 changed files with 532 additions and 104 deletions
+16 -2
View File
@@ -15,12 +15,26 @@ COPY . .
# Download dependencies
RUN go mod tidy
# Install Node.js and npm for Tailwind CSS building
RUN apk add --no-cache nodejs npm
# Copy package files and install npm dependencies
COPY package*.json ./
RUN npm install
# Copy source code (after npm to avoid re-running npm install on code changes)
COPY . .
# Generate sqlc code
RUN sqlc generate
# Generate templ code
RUN templ generate
# Build Tailwind CSS and download htmx
RUN npm run build:css:prod
RUN npm run postinstall
# Build the application
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o main ./cmd/server
@@ -33,8 +47,8 @@ WORKDIR /root/
# Copy the binary from builder stage
COPY --from=builder /app/main .
# Copy migrations (if needed for initialization)
COPY --from=builder /app/migrations ./migrations
# Copy database schema (if needed for initialization)
COPY --from=builder /app/database/schema ./database/schema
# Copy templates
COPY --from=builder /app/templates ./templates