Skip to content

Conversation

@sethreec
Copy link
Collaborator

@sethreec sethreec commented Dec 3, 2025

Deploys the docker image to AWS. A few things are clunky, such as reinstalling Docker each time, but we can see that the image is pulled onto the server and the container is run. More work is needed, hence not merging to main, but would make sense to work on this now with the rest of the github actions items rather than a separate branch.

Note: currently the .yml file will stop Docker as soon as it successfully runs the updated container. This is because I don't want the AWS server constantly running while we work on this, but this can be removed easily by removing the last two lines of the .yml when we are ready

Note(!!): the AWS secrets are managed in Github secrets in the devtest environment. I am not sure that this is correct, so please triple check me that I am not exposing our API keys.

testing update for deploy job in the .yaml
made devtest environment to hold AWS secrets for testing
changed wrong job to devtest environment. corrected
had error with docker not being installed on the aws server. got instructions on how to install docker on ubuntu from docker website and included in script

changed 8000:8000 to 80:8000 to match online examples, will need reexamined

included command to stop docker after successfully running the container because I don't understand AWS and am worried about racking up a bill, but this will have to be removed before the aws deployment is functional
I guess all docker commands must be sudo? Seems sketchy.
docker was not installing correctly, so trying this alternative and much simpler command using apt-get instead of apt
updated logic to stop and then remove all docker containers before pulling and running the updated image
changed cleanup logic to stop the running weather_planner_app container, remove the container, and then remove the old image before pulling the newest
added || True statements to the cleanup logic to avoid breaking the script if the container/images are not there
@sethreec
Copy link
Collaborator Author

sethreec commented Dec 4, 2025

No review was provided. Merging due to lack of time. Work will continue on the gh_actions_api branch

@sethreec sethreec merged commit 85294c7 into gh_actions_api Dec 4, 2025
3 checks passed
@sethreec sethreec deleted the gh_actions_aws branch December 4, 2025 02:02
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

Successfully merging this pull request may close these issues.

5 participants