Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UUID Renews with Every Build of docker-compose, How can we set Permenant UUID and Prevent Generated new Instances on Amplify Website?? #95

Open
insiyatif opened this issue Apr 9, 2023 · 3 comments

Comments

@insiyatif
Copy link

insiyatif commented Apr 9, 2023

Hi,
I'm using Nginx via docker-compose with this configuration;

  nginx:
    image: nginx
    container_name: nginx
    hostname: RNginx
    ports:
      - "80:80"
      - "443:443"
    restart: always

# command: bash -c /etc/nginx/afy_custom_amplify_install.sh
#"apt-get update && apt-cache pkgnames | grep python3 && apt-get install git wget gcc python3 gnupg2 nano -y && curl -L -O https://github.com/nginxinc/nginx-amplify-agent/raw/master/packages/install.sh && API_KEY='THE_API_KEY' sh ./install.sh -y"

    volumes:
      - ./nginx/conf/:/etc/nginx/conf.d/:ro
      - ./certs/:/etc/nginx/certs/:ro    
      - ./nginx/log/:/var/log/nginx/:rw  
      - ./nginx/nginx/nginx.conf:/etc/nginx/nginx.conf:ro  
#      - ./nginx/amplify-agent/:/etc/amplify-agent/:rw
#      - ./nginx/nginx/afy_manual_amplify_install.sh:/etc/nginx/afy_manual_amplify_install.sh:ro
environment:
  - TZ=Europe/Istanbul
  - DEBIAN_FRONTEND=noninteractive

  webapi:
     ....
  web:
     ....
  mongo:
     ....
  etc...

I'm publishing my web/api etc.. projects almost everyday.
But whenever I re build docker-compose, Nginx is also builds, and with everybuilds, the uuid regenerated. Amplify.Nginx.com shows new monitoring screen via uuid changes.
My history gets interrupts by new instances.

I have tried using volumes for amplify-agent conf file before installing, the install.sh file, but I couldn't get succeded with many errors whatever I tried.

I want the amplify could be installed inside Nginx container first, then keep the uuid wheter the nginx builds again or not.

Thanks for your helps..

@defanator
Copy link
Contributor

@insiyatif consider using imagename configuration option (see https://github.com/nginxinc/docker-nginx-amplify#13-aggregate-mode for details)

@insiyatif
Copy link
Author

@defanator thanks for your answer. I have already tried that, but after you said, I run
docker run --name mynginx1 -e API_KEY='THE_API_KEY' -e AMPLIFY_IMAGENAME=my-service-123 -d nginx-amplify
script again with my key. But I got the error below:

[root@vmi740842 dockerTest]# docker run --name nginx -e API_KEY='THE_API_KEY' -e AMPLIFY_IMAGENAME=my-service-123 -d nginx-amplify
Unable to find image 'nginx-amplify:latest' locally
Trying to pull repository docker.io/library/nginx-amplify ... 
/usr/bin/docker-current: repository docker.io/nginx-amplify not found: does not exist or no pull access.
See '/usr/bin/docker-current run --help'.

nginx-amplify is not found. Actually, the main problem was this for me. I couldn't find this image, so I was running the nginx first, and then installing the amplify. But in that situation I couldn't have the previous uuid.

And normally I'm using docker-compose to build my apps, if it's possible for nginx and amplify too, it would be better.

What can I do now?

@defanator
Copy link
Contributor

@insiyatif you will need to either build your own image, or use any of prebuilt ones from https://hub.docker.com/r/nginxinc/amplify-agent/tags

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants