-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (25 loc) · 744 Bytes
/
Dockerfile
File metadata and controls
39 lines (25 loc) · 744 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
33
34
35
36
37
38
39
FROM golang:1.24.3-bookworm AS backend-build
WORKDIR /app
COPY backend/go.mod backend/go.sum ./
RUN go mod download
COPY backend/ .
RUN ls -la
RUN CGO_ENABLED=1 GOOS=linux go build -o /fileflow ./cmd/api/main.go
FROM node:slim AS frontend-build
WORKDIR /app
COPY frontend/package.json .
RUN npm install
RUN npm i --save-dev @types/node
COPY frontend .
RUN npm run build
FROM nginx:bookworm AS build-release-stage
WORKDIR /
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY run.sh /run.sh
COPY --from=backend-build /fileflow /fileflow
COPY --from=frontend-build /app/dist /usr/share/nginx/html
ENV PORT=8080
ENV DB_FILE_PATH=/etc/fileflow/data.db
ENV FS_FILE_PATH=/etc/fileflow/uploads
RUN chmod +x /run.sh
ENTRYPOINT ["/run.sh"]