Complete project cleanup: remove unneeded files, organize static assets, update .gitignore
This commit is contained in:
+3
-24
@@ -3,32 +3,14 @@ FROM golang:1.25-alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install Node.js and npm
|
||||
RUN apk add --no-cache nodejs npm
|
||||
|
||||
# Install sqlc
|
||||
RUN go install github.com/sqlc-dev/sqlc/cmd/sqlc@latest
|
||||
|
||||
|
||||
|
||||
# Copy backend source code
|
||||
COPY backend/ ./backend/
|
||||
|
||||
# Copy frontend source for building
|
||||
COPY frontend/package*.json ./frontend/
|
||||
WORKDIR /app/frontend
|
||||
|
||||
# Install frontend dependencies (cached if package.json unchanged)
|
||||
RUN npm ci
|
||||
|
||||
# Copy frontend source
|
||||
COPY frontend/ ./
|
||||
|
||||
# Build frontend
|
||||
RUN npm run build
|
||||
|
||||
# Go back to root
|
||||
WORKDIR /app
|
||||
# Download dependencies
|
||||
RUN cd backend && go mod tidy
|
||||
|
||||
# Generate sqlc code
|
||||
RUN cd backend && sqlc generate
|
||||
@@ -48,11 +30,8 @@ COPY --from=builder /app/main .
|
||||
# Copy migrations (if needed for initialization)
|
||||
COPY --from=builder /app/backend/migrations ./migrations
|
||||
|
||||
# Copy static files
|
||||
COPY --from=builder /app/frontend/build ./static
|
||||
|
||||
# Expose port
|
||||
EXPOSE 8080
|
||||
EXPOSE 8765
|
||||
|
||||
# Run the binary
|
||||
CMD ["./main"]
|
||||
Reference in New Issue
Block a user