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

Make Magento 2 configuration the default (~/nginx/magento2.flag) #52

Open
Aquive opened this issue Aug 16, 2021 · 3 comments
Open

Make Magento 2 configuration the default (~/nginx/magento2.flag) #52

Aquive opened this issue Aug 16, 2021 · 3 comments

Comments

@Aquive
Copy link

Aquive commented Aug 16, 2021

I catch myself regularly forgetting to set the magento2.flag. I'd like to suggest to make M2 the default config since M1 is deprecated a while. So default would be M2. And if someone needs M1 they can make magento1.flag :)

@vdloo
Copy link
Member

vdloo commented Aug 19, 2021

we'll update that soon, touching the /data/web/nginx/magento2.flag flag by default sounds like a good idea. in the mean time you could write your own Dockerfile that uses the image and touches that file right?

edit: for reference, here's where the magento2.flag magic happens https://github.com/ByteInternet/nginx_config_reloader/blob/ee7b984507089fe0f67bb7a6d1e7f260a9a61d3f/nginx_config_reloader/__init__.py#L100

@Aquive
Copy link
Author

Aquive commented Aug 19, 2021

I don't have experience editing or making custom docker files (yet). Just using the stock image :)

Do you have a guide for this on de Hypernode docs? If not, I'll just wait. It certainly isn't a showstopper.

@vdloo
Copy link
Member

vdloo commented Aug 23, 2021

Here's a very basic example:

$ ls
Dockerfile
$ cat Dockerfile 
FROM docker.hypernode.com/byteinternet/hypernode-buster-docker:latest
RUN touch /data/web/nginx/magento2.flag
RUN /usr/bin/nginx_config_reloader
$ docker build -t myhypernodedocker .
Sending build context to Docker daemon  2.048kB
Step 1/3 : FROM docker.hypernode.com/byteinternet/hypernode-buster-docker:latest
 ---> cc798fc775a4
Step 2/3 : RUN touch /data/web/nginx/magento2.flag
 ---> Using cache
 ---> 547bfb5525c3
Step 3/3 : RUN /usr/bin/nginx_config_reloader
 ---> Running in bb0c984cbff4
2021-08-23 14:07:36,634 nginx_config_reloader INFO     /data/web/nginx
2021-08-23 14:07:36,714 nginx_config_reloader WARNING  Not reloading, nginx not running
Removing intermediate container bb0c984cbff4
 ---> 5eb1580c1275
Successfully built 5eb1580c1275
Successfully tagged myhypernodedocker:latest
$ docker run myhypernodedocker

now when you log in to the container with SSH you'll see your Dockerfile's changes reflected in the container:

root@4c0f86c798b4 /etc/nginx # ls -slthra | grep magento2
4.0K -rw-r--r-- 1 root root    3.4K Jul  3 14:22 magento2.conf
   0 lrwxrwxrwx 1 root root      24 Aug 23 14:07 magento.conf -> /etc/nginx/magento2.conf
root@4c0f86c798b4 /etc/nginx # ls /data/web/nginx/ | grep magento2
magento2.flag

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

No branches or pull requests

2 participants