-
Notifications
You must be signed in to change notification settings - Fork 69
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (27 loc) · 737 Bytes
/
Dockerfile
File metadata and controls
32 lines (27 loc) · 737 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Stage 1: Build the frontend
FROM node:20-alpine AS frontend-builder
WORKDIR /web
COPY web/package*.json ./
RUN npm install
COPY web/ .
RUN npm run build
# Stage 2: Build the backend
FROM golang:1.23-alpine AS backend-builder
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
# Remove existing public files and copy built frontend
RUN rm -rf server/public/*
COPY --from=frontend-builder /web/dist/ server/public/
RUN go build -o tavily-proxy server/main.go
# Stage 3: Final image
FROM alpine:latest
RUN apk --no-cache add ca-certificates tzdata
WORKDIR /app
COPY --from=backend-builder /app/tavily-proxy .
VOLUME /app/data
ENV DATABASE_PATH=/app/data/proxy.db
ENV LISTEN_ADDR=:8080
EXPOSE 8080
CMD ["./tavily-proxy"]