Skip to content

Porter Docker#2724

Merged
KPrasch merged 1 commit intonucypher:porterfrom
derekpierre:containerization
Jun 25, 2021
Merged

Porter Docker#2724
KPrasch merged 1 commit intonucypher:porterfrom
derekpierre:containerization

Conversation

@derekpierre
Copy link
Copy Markdown
Member

@derekpierre derekpierre commented Jun 16, 2021

Type of PR:

  • Bugfix
  • Feature
  • Documentation
  • Other

Required reviews:

  • 1
  • 2
  • 3

What this does:
Docker compose for Porter service. Based over #2720 .

Issues fixed/closed:

Fixes #2669

@derekpierre derekpierre added this to the Porter v1 (MVP) milestone Jun 16, 2021
@derekpierre derekpierre added the Web Webpages label Jun 16, 2021
@derekpierre derekpierre self-assigned this Jun 16, 2021
@derekpierre derekpierre changed the title [WIP] Porter Docker Porter Docker Jun 16, 2021
@derekpierre derekpierre marked this pull request as ready for review June 16, 2021 16:20
@derekpierre derekpierre mentioned this pull request Jun 16, 2021
7 tasks
@vepkenez
Copy link
Copy Markdown
Contributor

I actually really think that all of this stuff with TLS is not where we want to be spending our time. Nginx really does that well, and it is trivial and normal and best practice to use that highly optimized software for TLS termination.

Outside of places where we want to tie together identity with certificates (which has led to some minor ruin), it doesn't really make sense to have code in NuCypher that deals with https.

Obviously I had forever to comment on this and it's a little late right now and I deeply respect and appreciate the time spent dealing with it and I'm sorry I didn't chime in with all this at a more appropriate hour but all the lines of code dealing with TLS CLI options are lines of code that are already in NGINX and could be gotten for free with docker-compose.

@derekpierre
Copy link
Copy Markdown
Member Author

@vepkenez, as part of running Porter we are already running a web server (Hendrix) so at the moment putting nginx on top of that seems superfluous.

That being said, as a view to the future, I have been playing around a little with using nginx as a reverse proxy, to potentially allow for more complex authentication mechanisms for users of Porter (see #2706 ). It is unclear how Porter will be run, and how the users of the Porter service will be authenticated. Simple basic auth can be baked into Porter directly relatively easily, but anything more involved like OAuth2 or Token Authentication may necessitate something like nginx.

To that end this was the beginning of the docker-compose to get nginx working as a reverse proxy - without any authentication:

version: '3'

services:

  nginx-proxy:
    restart: always
    image: nginxproxy/nginx-proxy:alpine
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - /var/run/docker.sock:/tmp/docker.sock:ro
      - "${TLS_DIR}:/etc/nginx/certs/"

  porter:
    restart: on-failure
    image: nucypher:latest
    build:
      context: ../../..
      dockerfile: deploy/docker/Dockerfile
    expose:
      # Default Porter port
      - "9155"
    volumes:
      - .:/code
      - ~/.local/share/nucypher:/nucypher
    command: [ "nucypher", "porter", "run",
               "--provider", "${WEB3_PROVIDER_URI}",
               "--network", "${NUCYPHER_NETWORK}" ]
    environment:
      - VIRTUAL_HOST=porter.local
      - VIRTUAL_PORT=9155
    depends_on:
      - nginx-proxy

Copy link
Copy Markdown
Member

@KPrasch KPrasch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤠

@derekpierre derekpierre linked an issue Jun 23, 2021 that may be closed by this pull request
"--provider", "${WEB3_PROVIDER_URI}",
"--network", "${NUCYPHER_NETWORK}"]

porter-https:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good although on an architectural level, if we're using docker-compose, maybe the ssl would be just as well handled by having an nginx container acting as a reverse proxy and then forwarding to the nucypher container on port 80. Then you would just have one NuCypher container defined in here, and an nginx container.

kinda like this https://dzone.com/articles/how-to-nginx-reverse-proxy-with-docker-compose

@KPrasch KPrasch merged commit 7cabe71 into nucypher:porter Jun 25, 2021
@derekpierre derekpierre mentioned this pull request Jul 2, 2021
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Containerization/Deployment of Porter

3 participants