question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Procedure for updating Nginx Docker image

See original GitHub issue

Regarding the docker image which meteor-up uses for the proxy; is it possible to update to a newer version of this image using the mup CLI, or is there an accepted way to do this? This is necessary to keep nginx up to date, but I want to do so without interfering with the normal mup process, so I’ve been avoiding manually updating the image.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:4
  • Comments:6

github_iconTop GitHub Comments

2reactions
Batistlemancommented, Dec 27, 2021

I agree, the current nginx version for this package is: 1.19.3, and has the following security concerns: https://nvd.nist.gov/vuln/detail/CVE-2021-23017

I think it would be possible just to replace:

FROM jwilder/nginx-proxy:0.8.0

with:

FROM nginxproxy/nginx-proxy:0.9

in the repo: https://github.com/zodern/nginx-proxy/blob/master/Dockerfile

references:

1reaction
dumskicommented, Nov 20, 2021

Hi, @conorstrejcek, I’ve managed to run jwilder/nginx-proxy:latest as an alternative to the default nginx-proxy image. Just wanetd to share my solution with you.

I used this file as a guide to run jwilder’s image. Just log into your server (as root if you need this to manage docker container). This script is does this:

#!/bin/bash

# set env variables
APPNAME=mup-nginx-proxy
APP_PATH=/opt/$APPNAME
NGINX_PROXY_VERSION="latest"
ENV_FILE=$APP_PATH/config/env.list
NGINX_CONFIG_PATH="/opt/$APPNAME/config/nginx-default.conf"
TEMPLATE_PATH=/opt/$APPNAME/config/nginx.tmpl
HTTP_PORT=80
HTTPS_PORT=443

# stop & remove zodern's container
echo 'Stopping & removing old container'
docker stop $APPNAME
docker rm $APPNAME

# run container using custom image (jwilder/nginx-proxy)

echo 'Running the new one'
sudo docker run \
  -d \
  -p $HTTP_PORT:80 \
  -p $HTTPS_PORT:443 \
  --name $APPNAME \
  --env-file=$ENV_FILE \
  --restart=always \
  --log-opt max-size=100m \
  --log-opt max-file=7 \
  --network bridge \
  -v $TEMPLATE_PATH:/app/nginx.tmpl:ro \
  -v /opt/$APPNAME/mounted-certs:/etc/nginx/certs \
  -v /opt/$APPNAME/config/vhost.d:/etc/nginx/vhost.d \
  -v /opt/$APPNAME/config/html:/usr/share/nginx/html \
  -v /opt/$APPNAME/config/htpasswd:/etc/nginx/htpasswd  \
  -v /opt/$APPNAME/config/nginx-default.conf:/etc/nginx/conf.d/my_proxy.conf:ro \
  -v /var/run/docker.sock:/tmp/docker.sock:ro \
  -v /opt/$APPNAME/upstream:/etc/nginx/upstream \
  jwilder/nginx-proxy:$NGINX_PROXY_VERSION


# same with a companion container

docker stop $APPNAME-letsencrypt
docker rm $APPNAME-letsencrypt

LETSENCRYPT_COMPANION_VERSION="v1.13.1"
ENV_FILE_LETSENCRYPT=$APP_PATH/config/env_letsencrypt.list

sudo docker run \
  -d \
  --name $APPNAME-letsencrypt \
  --env-file=$ENV_FILE_LETSENCRYPT \
  --restart=always \
  --volumes-from $APPNAME \
  --log-opt max-size=100m \
  --log-opt max-file=3 \
  -v /var/run/docker.sock:/var/run/docker.sock:ro \
  jrcs/letsencrypt-nginx-proxy-companion:$LETSENCRYPT_COMPANION_VERSION


echo 'Current containers running:'
docker ps

Also @zodern, since we have this simple workaround, could you, please, consider to add ability to use custom nginx-proxy docker image? I don’t have skills to fork and build npm package to add this option to mup. I think a proxy.image option in mup.js would be awesome!

Cheers, Teo

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Deploy an NGINX Image with Docker
Use the NGINX image from the Docker Hub repository or create your own NGINX Plus image to easily deploy NGINX in Docker containers....
Read more >
Quick deployment: NGINX within a Docker container - AskF5
Open a command prompt on your host system running Docker, with administrative privileges. Deploy the default NGINX image, binding volumes for ...
Read more >
nginx - Official Image - Docker Hub
How to use this image. Hosting some simple static content. $ docker run --name some-nginx -v /some/content:/usr/share/nginx/html:ro -d nginx.
Read more >
How To Containerize and Use Nginx as a Proxy | DigitalOcean
In this DigitalOcean article, we will learn about quickly setting up docker, creating a docker container from a base image, and building it...
Read more >
Upgrading the Wallarm Docker NGINX- or Envoy-based image
Step 1: Download the updated filtering node image¶ · Step 2: Stop the running container¶ · Step 3: Run the container using the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found