Skip to content

Commit c2f3158

Browse files
committed
docker: pass version and clean interval
1 parent c977d4a commit c2f3158

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

build/Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
FROM node:13-alpine as ui-build
22
COPY web /tmp/web
33
WORKDIR /tmp/web
4-
RUN yarn install --silent && yarn build
4+
ARG APP_VERSION="1.0.0"
5+
ARG GITHUB_URL="https://github.com/x1unix/go-playground"
6+
RUN REACT_APP_VERSION=${APP_VERSION} REACT_APP_GITHUB_URL=${GITHUB_URL} yarn install --silent && yarn build
57

68
FROM golang:1.13-alpine as build
79
WORKDIR /tmp/playground
@@ -14,8 +16,9 @@ RUN go build -o server ./cmd/playground
1416
FROM golang:1.13-alpine as production
1517
WORKDIR /opt/playground
1618
ENV GOROOT /usr/local/go
19+
ENV APP_CLEAN_INTERVAL=10m
1720
COPY data ./data
1821
COPY --from=ui-build /tmp/web/build ./public
1922
COPY --from=build /tmp/playground/server .
2023
EXPOSE 8000
21-
ENTRYPOINT ["/opt/playground/server", "-f=/opt/playground/data/packages.json", "-addr=:8000"]
24+
ENTRYPOINT /opt/playground/server -f=/opt/playground/data/packages.json -addr=:8000 -clean-interval=${APP_CLEAN_INTERVAL}

docker.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ docker-make-image:
2323
echo "required parameter TAG is undefined" && exit 1; \
2424
fi;
2525
@echo "- Building '$(IMG_NAME):latest' $(TAG)..."
26-
docker image build -t $(IMG_NAME):latest -t $(IMG_NAME):$(TAG) -f $(DOCKERFILE) .
26+
docker image build -t $(IMG_NAME):latest -t $(IMG_NAME):$(TAG) -f $(DOCKERFILE) --build-arg APP_VERSION=$(TAG) .

0 commit comments

Comments
 (0)