build: update Dockerfile for TypeScript compilation
- Add npm run build:ts step to compile TypeScript - Copy web/ directory instead of cmd/server/static/ - Build pipeline now: Go deps → CSS → HTMX → TypeScript → Go binary - TypeScript compiles to JavaScript before final image build Integrates TypeScript compilation into container build process.
This commit is contained in:
+5
-2
@@ -32,6 +32,9 @@ RUN cd templates && templ generate
|
||||
RUN npm run build:css:prod
|
||||
RUN npm run postinstall
|
||||
|
||||
# Build TypeScript to JavaScript
|
||||
RUN npm run build:ts
|
||||
|
||||
# Build the application
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o main ./cmd/server
|
||||
|
||||
@@ -50,8 +53,8 @@ COPY --from=builder /app/database/schema ./database/schema
|
||||
# Copy generated templates
|
||||
COPY --from=builder /app/templates ./templates
|
||||
|
||||
# Copy static assets
|
||||
COPY --from=builder /app/cmd/server/static ./static
|
||||
# Copy web assets (HTML, CSS, JS, etc.)
|
||||
COPY --from=builder /app/web ./web
|
||||
|
||||
# Expose port
|
||||
EXPOSE 8765
|
||||
|
||||
Reference in New Issue
Block a user