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

figure out and implement a reasonable mapping for eventimages folder, adjusting nginx and docker to handle #633

Closed
fool opened this issue Mar 11, 2024 · 1 comment

Comments

@fool
Copy link
Member

fool commented Mar 11, 2024

This should cover both saving and showing - as of 7 Mar, it looked like new event images are beign saved to /opt/shift-docs/app/eventimages/EVENTID.EXT, but fool thinks nginx doesn't point to that location!
Perhaps this storage should also be outside of the container like mysql? Maybe we could use /opt/shift-data/eventimages like /opt/shift-data/mysql in #630 ?

Should also when we do this update shift_domain as mentioned here to point to beta.shift2bikes.org: https://shift2bikes.slack.com/archives/CCFLDTCF7/p1710189275348339?thread_ts=1709871971.848139&cid=CCFLDTCF7

Once decided and imoplemented, also please copy in images from live server and report back as to how you did it and any permissions changes needed before closing this issue

@ionous
Copy link
Contributor

ionous commented Mar 12, 2024

the old ngnix container points to the images directory via its conf here:

 location ~ /eventimages/(\d+)(?:-\d+).(\w+) {
      alias /opt/backend/eventimages/$1.$2;
      expires max;
  }
 location /eventimages {
      alias /opt/backend/eventimages;
 }

and it looks like docker compose mapped /opt/backed/images to the local host, here:

- "${EVENTIMAGES}:/opt/backend/eventimages"

the EVENTIMAGES env var for local development ( and possibly production? ) gets set via the ./shift script here:

export ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
export SERVICES="${ROOT}/services"
export EVENTIMAGES="${ROOT}/backend/eventimages"

it's not an true "volume" i think, but since that directory exists on the host; it still persists across reboots and docker image reinstalls. ( note: changes to files on an image do persist across reboots according to the docker docs; but reinstalls/upgrades of the docker image itself would erases anything that wasn't stored externally -- in an explicit volume or mapped on to the host )

@fool fool closed this as completed Oct 15, 2024
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