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

Refactor: move the application directory up a level #42

Merged
merged 2 commits into from
Jun 11, 2024

Conversation

thekaveman
Copy link
Member

@thekaveman thekaveman commented Jun 11, 2024

There are two directories with application code:

  • run/ is created by this image and contains the default nginx and gunicorn configuration
  • app/ is created by the consuming image (benefits or eligibility-server) and contains the application code

This image defines these two directories under /home/calitp/ (the Docker $USERs home).

This PR moves them to the top-level /calitp/ (again, from the Docker $USER).

This change is part of addressing cal-itp/benefits#2153. When we enable the setting WEBSITES_ENABLE_APP_SERVICE_STORAGE=true, /home will be a directory managed by the Azure App Service, so we need the application code out of that directory.

Post-merge

Merge the following PRs

Copy link
Member

@angela-tran angela-tran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to update this path too or no?

# update PATH for local pip installs
ENV PATH "$PATH:/home/$USER/.local/bin"

@thekaveman
Copy link
Member Author

thekaveman commented Jun 11, 2024

Do we need to update this path too or no?

# update PATH for local pip installs
ENV PATH "$PATH:/home/$USER/.local/bin"

I don't think so, because pip install as the $USER is still going to install packages into the user's home directory (which does still exist).

You can test this by building the image:

docker compose build app

Then running the container, and running pip freeze inside the container, which should print that gunicorn is installed:

$ docker compose run app
calitp@90b7dd99b3f3:/calitp/app$ pip freeze
gunicorn==22.0.0
packaging==24.1

@thekaveman thekaveman merged commit 7b04620 into main Jun 11, 2024
1 check passed
@thekaveman thekaveman deleted the refactor/app-dir branch June 11, 2024 23:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants