generated from cheqd/.github
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Andrew Nikitin <andrew.nikitin@cheqd.io>
- Loading branch information
Andrew Nikitin
committed
Apr 14, 2022
1 parent
d4c23e4
commit 9673e94
Showing
3 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Port which will be used for incoming requests on resolver side | ||
RESOLVER_PORT="1313" | ||
|
||
# Drivers port for application side. | ||
# For example, if you application will send requests to http://localhost/ | ||
# then port should be 80 | ||
REDIRECTED_PORT="80" | ||
|
||
LOCAL_REDIRECT_FROM=localhost:80 | ||
|
||
# Address with port of external DID-Resolver. | ||
EXTERNAL_REDIRECT_TO=http://localhost:1313 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
############################################################### | ||
### STAGE 1: Build did-resolver binary pre-requisites ### | ||
############################################################### | ||
|
||
FROM golang:1.17.8-buster as builder | ||
|
||
WORKDIR /root | ||
|
||
COPY types ./types | ||
COPY services ./services | ||
COPY go.mod . | ||
COPY go.sum . | ||
COPY main.go . | ||
|
||
RUN ls -la | ||
# Make did-resolver binary | ||
RUN go build -o did-resolver main.go | ||
|
||
############################################################### | ||
### STAGE 2: Build did-resolver runner ### | ||
############################################################### | ||
|
||
FROM ubuntu:focal AS runner | ||
LABEL org.opencontainers.image.description "Cheqd DID-Resolver runner" | ||
LABEL org.opencontainers.image.source "https://github.com/cheqd/cheqd-did-resolver" | ||
|
||
# Copy compiled did-resolver binary from Stage 1 | ||
COPY --from=builder /root/did-resolver /bin | ||
|
||
# Copy base config.yml | ||
WORKDIR /root | ||
|
||
EXPOSE 1313 | ||
ENTRYPOINT ["did-resolver"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
version: '3.7' | ||
|
||
|
||
services: | ||
did_resolver: | ||
build: | ||
dockerfile: docker/Dockerfile | ||
context: ../ | ||
configs: | ||
- source: config | ||
target: /root/config.yml | ||
expose: | ||
- ${RESOLVER_PORT} | ||
ports: | ||
- "${RESOLVER_PORT}:${RESOLVER_PORT}" | ||
profiles: | ||
- resolver | ||
|
||
redirect: | ||
image: morbz/docker-web-redirect | ||
restart: always | ||
ports: | ||
- "${REDIRECTED_PORT}:${REDIRECTED_PORT}" | ||
environment: | ||
- VIRTUAL_HOST={LOCAL_REDIRECT_FROM} | ||
- REDIRECT_TARGET=${EXTERNAL_REDIRECT_TO} | ||
profiles: | ||
- driver | ||
|
||
configs: | ||
config: | ||
file: ../config.yml |