basic frontend
Some checks failed
continuous-integration/drone/pr Build is failing
continuous-integration/drone/push Build is passing

This commit is contained in:
aovantsev
2025-10-03 11:32:59 +03:00
parent 78122bc996
commit 324e861218
35 changed files with 20764 additions and 22 deletions

View File

@@ -1,5 +1,5 @@
# Build stage
FROM golang:1.21-alpine AS builder
# Build stage for Go backend
FROM golang:1.21-alpine AS go-builder
WORKDIR /app
@@ -10,11 +10,28 @@ COPY go.mod go.sum ./
RUN go mod download
# Copy source code
COPY . .
COPY *.go ./
# Build the application
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o main .
# Build stage for React frontend
FROM node:18-alpine AS frontend-builder
WORKDIR /app/frontend
# Copy package files
COPY frontend/package*.json ./
# Install dependencies
RUN npm ci --only=production
# Copy source code
COPY frontend/ ./
# Build the React app
RUN npm run build
# Final stage
FROM alpine:latest
@@ -23,8 +40,11 @@ RUN apk --no-cache add ca-certificates
WORKDIR /root/
# Copy the binary from builder stage
COPY --from=builder /app/main .
# Copy the Go binary from go-builder stage
COPY --from=go-builder /app/main .
# Copy the React build from frontend-builder stage
COPY --from=frontend-builder /app/frontend/build ./frontend/build
# Expose port
EXPOSE 8080