Skip to content

Commit

Permalink
DEV-1074: Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Toktar committed Apr 20, 2022
1 parent 9c60d38 commit 9ffa81c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
22 changes: 10 additions & 12 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,7 @@

FROM golang:1.17.8-buster as builder

# Set user directory and details
ENV CHEQD_RESOLVER_HOME_DIR="/home/cheqd-resolver"
ARG UID=1000
ARG GID=1000

# Add cheqd user to use in the container
RUN groupadd --system --gid $GID cheqd-resolver \
&& useradd --system --create-home --home-dir ${CHEQD_RESOLVER_HOME_DIR} --shell /bin/bash --gid cheqd-resolver --uid $UID cheqd-resolver

WORKDIR ${CHEQD_RESOLVER_HOME_DIR}
USER cheqd-resolver
WORKDIR /root

COPY types ./types
COPY services ./services
Expand All @@ -34,11 +24,19 @@ LABEL org.opencontainers.image.description "Cheqd DID-Resolver runner"
LABEL org.opencontainers.image.source "https://github.com/cheqd/cheqd-did-resolver"
ENV CHEQD_RESOLVER_HOME_DIR="/home/cheqd-resolver"

# Set user directory and details
ARG UID=1000
ARG GID=1000
# Add cheqd user to use in the container
RUN groupadd --system --gid $GID cheqd-resolver \
&& useradd --system --create-home --home-dir ${CHEQD_RESOLVER_HOME_DIR} --shell /bin/bash --gid cheqd-resolver --uid $UID cheqd-resolver

# Copy compiled cheqd-did-resolver binary from Stage 1
COPY --from=builder ${CHEQD_RESOLVER_HOME_DIR} /bin
COPY --from=builder /root /bin

# Copy base config.yml
WORKDIR ${CHEQD_RESOLVER_HOME_DIR}

USER cheqd-resolver
EXPOSE 1313
ENTRYPOINT ["cheqd-did-resolver"]
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func main() {
}

viper.SetConfigFile(".env")
err := viper.ReadInConfig()
err = viper.ReadInConfig()
if err != nil { // Handle errors reading the config file
panic(fmt.Errorf("Fatal error config file: %w \n", err))
}
Expand Down

0 comments on commit 9ffa81c

Please sign in to comment.