shift-org / shift-docs

Shift2Bikes: website and calendar for shift and pedalpalooza
https://shift2bikes.org
Other
22 stars 17 forks source link

Specify Nginx version in docker-compose.yml #722

Closed ejfinneran closed 5 months ago

ejfinneran commented 5 months ago

We use the 'ssl' directive which was marked as deprecated in 1.15 of nginx and removed in 1.25.1 so if you run run shift up on a new machine, you'll get a version of nginx that doesn't support our config

I took a guess and pinned this at 1.15 but it probably makes more sense to match this to the version running in production. If someone can share that with me, I can update this PR.

See: https://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl

➜  ~ docker ps
CONTAINER ID   IMAGE               COMMAND                  CREATED          STATUS                         PORTS                                                    NAMES
e493098bdc81   nginx               "/opt/nginx/entrypoi…"   21 seconds ago   Restarting (1) 4 seconds ago                                                            shift-nginx-1
ef44f38fb076   node:20.11.1-slim   "docker-entrypoint.s…"   21 seconds ago   Up 18 seconds                                                                           shift-node-1
846a162bbb1c   mysql:5.7           "docker-entrypoint.s…"   33 seconds ago   Up 18 seconds                  33060/tcp, 0.0.0.0:32774->3306/tcp, :::32774->3306/tcp   shift-db-1
79ca7055e3f3   jojomi/hugo:0.84    "hugo -v"                46 seconds ago   Up 19 seconds                  1313/tcp                                                 shift-hugo-1
d7d4c45a5027   postgres:15         "docker-entrypoint.s…"   27 hours ago     Up 27 hours                    0.0.0.0:5433->5432/tcp, :::5433->5432/tcp                postgres-test
➜  ~ docker logs e493098bdc81
services/nginx/entrypoint.sh
nginx up
2024/06/05 23:37:09 [emerg] 1#1: unknown directive "ssl" in /etc/nginx/conf.d/shift.conf:10
nginx: [emerg] unknown directive "ssl" in /etc/nginx/conf.d/shift.conf:10
services/nginx/entrypoint.sh
nginx up
2024/06/05 23:37:12 [emerg] 1#1: unknown directive "ssl" in /etc/nginx/conf.d/shift.conf:10
nginx: [emerg] unknown directive "ssl" in /etc/nginx/conf.d/shift.conf:10
services/nginx/entrypoint.sh
nginx up
ionous commented 5 months ago

nice catch! it looks like we're running: nginx version: nginx/1.17.8 on production. ( i attached to the running docker nginx container, and used: nginx -v )

ejfinneran commented 5 months ago

Great! Updated the PR.

ionous commented 5 months ago

rocking, thanks! i'll try pulling it down tomorrow. we generally only merge backend prs when we have meetings ( because merging triggers a deploy, and it's good to have multiple eyes if something unexpected goes sideways ) -- so maybe monday, if folks are able to get together then.

ionous commented 5 months ago

tested locally and ./shift rebuild pulls down and successfully runs the correct version for me. ( production will already have that version, so ./shift pull shouldn't wind up doing anything special ) looks good.

carrythebanner commented 5 months ago

Great fix @ejfinneran, thanks!