forked from gitploy-io/gitploy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
48 lines (34 loc) · 1.02 KB
/
Dockerfile
File metadata and controls
48 lines (34 loc) · 1.02 KB
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
# Build the server binary file.
FROM golang:1.17 AS server
ARG OSS=false
WORKDIR /server
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN if [ "${OSS}" = "false" ]; then \
echo "Build the enterprise edition"; \
go build -o gitploy-server ./cmd/server; \
else \
echo "Build the community edition"; \
go build -o gitploy-server -tags "oss" ./cmd/server; \
fi
# Build UI.
FROM node:14.17.0 AS ui
ARG OSS=false
WORKDIR /ui
ENV PATH /ui/node_modules/.bin:$PATH
COPY ./ui/package.json ./ui/package-lock.json ./
RUN npm install --silent
COPY ./ui ./
ENV REACT_APP_GITPLOY_OSS="${OSS}"
RUN npm run build
# Copy to the final image.
FROM golang:1.17-buster AS gitploy
WORKDIR /app
# Create DB
RUN mkdir /data
COPY --from=server --chown=root:root /server/LICENSE /server/NOTICE ./
COPY --from=server --chown=root:root /server/gitploy-server /go/bin/gitploy-server
# Copy UI output into the assets directory.
COPY --from=ui --chown=root:root /ui/build/ /app/
ENTRYPOINT [ "/go/bin/gitploy-server" ]