-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
48 lines (33 loc) · 1.02 KB
/
Dockerfile
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Start from the official Go image.
FROM golang:1.22.1 as builder
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
# Build the Go app
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o llm_checker ./cmd/llm_checker
######## Start a new stage from scratch #######
FROM node:14 as frontend_builder
WORKDIR /web
COPY web/package.json ./
RUN npm install
RUN npm install -D tailwindcss
RUN npx tailwindcss init
COPY web/ ./
# Build the React app
RUN npm run build
######## Start a new stage from scratch #######
FROM python:3.11
WORKDIR /root
# Copy the Pre-built backend binary file from the previous stage
COPY --from=builder /app/llm_checker .
# Copy the Pre-built frontend files from the previous stage
COPY --from=frontend_builder /web/build ./web/build
# Copy python script
COPY scripts/compare_texts.py ./python/
COPY scripts/requirements.txt ./python/
RUN pip install -r python/requirements.txt
# Expose port 8080 to the outside world
EXPOSE 8080
# Command to run the Python script
CMD ["./llm_checker"]