Skip to content

Commit f94df73

Browse files
authored
http-gateway: add UI to docker image (#548)
1 parent 9e2ff5f commit f94df73

3 files changed

Lines changed: 20 additions & 4 deletions

File tree

.github/workflows/publishDockerImagesGhcr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
file: tools/docker/Dockerfile
5151
- name: http-gateway
5252
directory: http-gateway
53-
file: tools/docker/Dockerfile
53+
file: http-gateway/Dockerfile
5454
- name: identity-store
5555
directory: identity-store
5656
file: tools/docker/Dockerfile

http-gateway/Dockerfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM golang:1.16.4-alpine AS build
2+
RUN apk add --no-cache curl git build-base
3+
WORKDIR $GOPATH/src/github.com/plgd-dev/hub
4+
COPY go.mod go.sum ./
5+
RUN go mod download
6+
COPY . .
7+
WORKDIR $GOPATH/src/github.com/plgd-dev/hub/http-gateway
8+
RUN go build -o /go/bin/http-gateway ./cmd/service
9+
10+
FROM node:12 AS build-web
11+
COPY http-gateway/web /web
12+
RUN cd /web && npm install && npm run build
13+
14+
FROM alpine:3.14 as service
15+
RUN apk add --no-cache ca-certificates
16+
COPY --from=build-web /web/build /usr/local/var/www
17+
COPY --from=build /go/bin/http-gateway /usr/local/bin/http-gateway
18+
ENTRYPOINT [ "/usr/local/bin/http-gateway" ]

http-gateway/Makefile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,10 @@ default: build
88
define build-docker-image
99
cd .. && docker build \
1010
--network=host \
11-
--build-arg DIRECTORY=$(SERVICE_NAME) \
12-
--build-arg NAME=$(SERVICE_NAME) \
1311
--tag plgd/$(SERVICE_NAME):$(VERSION_TAG) \
1412
--tag plgd/$(SERVICE_NAME):$(LATEST_TAG) \
1513
--target $(1) \
16-
-f tools/docker/Dockerfile \
14+
-f $(SERVICE_NAME)/Dockerfile \
1715
.
1816
endef
1917

0 commit comments

Comments
 (0)