Skip to content

Commit

Permalink
Merge pull request #16 from c4dt/noTLS-docker
Browse files Browse the repository at this point in the history
feat: Docker using --noTLS
  • Loading branch information
ineiti authored Oct 5, 2023
2 parents 071c9e4 + 4d69872 commit 6b6ddc4
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 46 deletions.
14 changes: 2 additions & 12 deletions Dockerfiles/Dockerfile.dela
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,11 @@ RUN go install
WORKDIR /go/d-voting
COPY . .

FROM base AS production
FROM base AS build
COPY --from=base /go/dela .
COPY --from=base /go/d-voting .
WORKDIR /go/d-voting/cli/dvoting
RUN go build
ENV PATH=/go/dela/cli/crypto:/go/d-voting/cli/dvoting:${PATH}
ENTRYPOINT ["/bin/bash", "-c", "dvoting --config /data/node start --postinstall --proxyaddr :$PROXYPORT --proxykey $PROXYKEY --listen tcp://0.0.0.0:2000 --public http://$HOSTNAME:$NODEPORT --routing tree"]
CMD []

FROM base AS debug
COPY --from=base /go/dela .
COPY --from=base /go/d-voting .
RUN go install github.com/go-delve/delve/cmd/dlv@latest
WORKDIR /go/d-voting/cli/dvoting
RUN go build -gcflags="all=-N -l"
ENV PATH=/go/dela/cli/crypto:/go/d-voting/cli/dvoting:${PATH}
ENTRYPOINT ["/bin/bash", "-c", "dlv --listen=:40000 --headless=true --api-version=2 --accept-multiclient exec /go/d-voting/cli/dvoting/dvoting -- --config /data/node start --postinstall --proxyaddr :$PROXYPORT --proxykey $PROXYKEY --listen tcp://0.0.0.0:2000 --public http://$HOSTNAME:2000 --routing tree"]
ENTRYPOINT ["/bin/bash", "-c", "dvoting --config /data/node start --postinstall --proxyaddr :$PROXYPORT --proxykey $PROXYKEY --listen tcp://0.0.0.0:2000 --public $PUBLIC_URL --routing tree --noTLS"]
CMD []
26 changes: 17 additions & 9 deletions docker-compose/docker-compose.debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,25 @@ x-dela: &dela
build:
dockerfile: Dockerfiles/Dockerfile.dela
context: ../
target: production
target: build
env_file: ../.env
profiles:
- dela
- all
environment:
PROXYKEY: ${PUBLIC_KEY}
PROXY_LOG: info
LLVL: info
x-dela-env: &dela-env
PROXYKEY: ${PUBLIC_KEY}
PROXY_LOG: info
LLVL: debug

services:

dela-worker-0: # inital DELA leader node
<<: *dela
environment:
<<: *dela-env
PUBLIC_URL: grpc://dela-worker-0:2000
volumes:
- dela-worker-0-data:/data
hostname: dela-worker-0
ports:
- 127.0.0.1:40000:40000
networks:
Expand All @@ -29,7 +31,9 @@ services:
<<: *dela
volumes:
- dela-worker-1-data:/data
hostname: dela-worker-1
environment:
<<: *dela-env
PUBLIC_URL: grpc://dela-worker-1:2000
ports:
- 127.0.0.1:40001:40000
networks:
Expand All @@ -39,7 +43,9 @@ services:
<<: *dela
volumes:
- dela-worker-2-data:/data
hostname: dela-worker-2
environment:
<<: *dela-env
PUBLIC_URL: grpc://dela-worker-2:2000
ports:
- 127.0.0.1:40002:40000
networks:
Expand All @@ -49,7 +55,9 @@ services:
<<: *dela
volumes:
- dela-worker-3-data:/data
hostname: dela-worker-3
environment:
<<: *dela-env
PUBLIC_URL: grpc://dela-worker-3:2000
ports:
- 127.0.0.1:40003:40000
networks:
Expand Down
45 changes: 20 additions & 25 deletions docker-compose/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
version: "3.8"
x-dela: &dela
image: ghcr.io/c4dt/d-voting-dela:latest
environment:
PROXYKEY: ${PUBLIC_KEY}
PROXYPORT: ${PROXYPORT}
PROXY_LOG: info
LLVL: info
NODEPORT: ${NODEPORT}
env_file: ../.env
x-dela-env: &dela-env
PROXYKEY: ${PUBLIC_KEY}
PROXY_LOG: info
LLVL: info

services:

Expand All @@ -15,34 +14,42 @@ services:
build:
dockerfile: Dockerfiles/Dockerfile.dela
context: ../
target: production
target: build
environment:
<<: *dela-env
PUBLIC_URL: grpc://dela-worker-0:2000
volumes:
- dela-worker-0-data:/data
hostname: dela-worker-0
networks:
d-voting:
ipv4_address: 172.19.44.254
dela-worker-1: # DELA worker node
<<: *dela
volumes:
- dela-worker-1-data:/data
hostname: dela-worker-1
environment:
<<: *dela-env
PUBLIC_URL: grpc://dela-worker-1:2000
networks:
d-voting:
ipv4_address: 172.19.44.253
dela-worker-2: # DELA worker node
<<: *dela
volumes:
- dela-worker-2-data:/data
hostname: dela-worker-2
environment:
<<: *dela-env
PUBLIC_URL: grpc://dela-worker-2:2000
networks:
d-voting:
ipv4_address: 172.19.44.252
dela-worker-3: # DELA worker node
<<: *dela
volumes:
- dela-worker-3-data:/data
hostname: dela-worker-3
environment:
<<: *dela-env
PUBLIC_URL: grpc://dela-worker-3:2000
networks:
d-voting:
ipv4_address: 172.19.44.251
Expand All @@ -54,9 +61,7 @@ services:
context: ../
ports:
- 127.0.0.1:3000:3000
environment:
BACKEND_HOST: ${BACKEND_HOST}
BACKEND_PORT: ${BACKEND_PORT}
env_file: ../.env
networks:
d-voting:
ipv4_address: 172.19.44.2
Expand All @@ -66,17 +71,7 @@ services:
build:
dockerfile: Dockerfiles/Dockerfile.backend
context: ../
environment:
DATABASE_USERNAME: ${DATABASE_USERNAME}
DATABASE_PASSWORD: ${DATABASE_PASSWORD}
DATABASE_HOST: ${DATABASE_HOST}
DATABASE_PORT: ${DATABASE_PORT}
DB_PATH: /data/${DB_PATH}
FRONT_END_URL: ${FRONT_END_URL}
DELA_NODE_URL: ${DELA_NODE_URL}
SESSION_SECRET: ${SESSION_SECRET}
PUBLIC_KEY: ${PUBLIC_KEY}
PRIVATE_KEY: ${PRIVATE_KEY}
env_file: ../.env
ports:
- 127.0.0.1:5000:5000
depends_on:
Expand Down

0 comments on commit 6b6ddc4

Please sign in to comment.