Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev-1074-did-resolver' into dev-…
Browse files Browse the repository at this point in the history
…1074-did-resolver
  • Loading branch information
Toktar committed Apr 14, 2022
2 parents d48c0be + 8d7e9a8 commit dc4a663
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 2 deletions.
35 changes: 35 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
###############################################################
### STAGE 1: Build did-resolver binary pre-requisites ###
###############################################################

FROM golang:1.17.8-buster as builder

WORKDIR /

COPY types /types
COPY services /services
COPY go.mod /
COPY go.sum /
COPY main.go /main.go

# 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 /did-resolver /bin

# Copy base config.yml
WORKDIR /root
COPY config.yml /root

#
EXPOSE 1313
ENTRYPOINT ["did-resolver"]
4 changes: 2 additions & 2 deletions config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
networks:
mainnet: rpc.cheqd.net:443
testnet: 127.0.0.1:9090
# testnet: api.testnet.cheqd.network:443
#testnet: 127.0.0.1:9090
testnet: 159.89.208.88:443
33 changes: 33 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
version: '3.7'


services:
did_resolver:
build:
dockerfile: Dockerfile
user: root
configs:
- source: config
target: /root/config.yml
expose:
- ${RESOLVER_PORT:-1313}
- 9090
ports:
- "${RESOLVER_PORT:-1313}:${RESOLVER_PORT:-1313}"
profiles:
- resolver

redirect:
image: morbz/docker-web-redirect
restart: always
ports:
- "${REDIRECTED_PORT:-80}:${REDIRECTED_PORT:-80}"
environment:
- VIRTUAL_HOST=localhost:80
- REDIRECT_TARGET=${CHEQD_RESOLVER_PATH:-http://localhost:1313}
profiles:
- driver

configs:
config:
file: config.yml

0 comments on commit dc4a663

Please sign in to comment.