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

Add working example for setting up local prod docker image. #302

Merged
merged 2 commits into from
Jan 29, 2025

Conversation

tpendragon
Copy link
Contributor

Closes #301

We might want to set this up in a docker-compose at some point..

Copy link

github-actions bot commented Jan 28, 2025

Container Scanning Status: ✅ Success


ghcr.io/pulibrary/dpul-collections:pr-302 (debian 12.6)
=======================================================
Total: 0 (HIGH: 0, CRITICAL: 0)

Copy link
Member

@hackartisan hackartisan left a comment

Choose a reason for hiding this comment

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

this works thank you! I have one comment but it's not a blocker.

insight as to which change fixed the "can't set long node name" error?

@@ -116,7 +116,7 @@ if config_env() == :prod do

host = System.get_env("PHX_HOST") || "example.com"
port = String.to_integer(System.get_env("PORT") || "4000")
check_origin = ["https://#{host}"]
check_origin = ["//#{host}"]
Copy link
Member

Choose a reason for hiding this comment

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

It seems like this could just be true woudl that be more straightforward? See https://hexdocs.pm/phoenix/Phoenix.Endpoint.html#socket/3-common-configuration

and looking at the host in prod:

iex([email protected])1> DpulCollectionsWeb.Endpoint.config(:url)[:host]
"dpul-collections-staging.lib.princeton.edu"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Works for me!

@tpendragon
Copy link
Contributor Author

insight as to which change fixed the "can't set long node name" error?

#117 is what did it. The argument that caused it was https://github.com/pulibrary/dpul-collections/pull/117/files#diff-3ecf6eeecfdb632f12cc8e3aae2fe865e0c643923f93166bf4c3a9d149364effR20 - RELEASE_IP wasn't set.

@hackartisan hackartisan merged commit 0126995 into main Jan 29, 2025
4 checks passed
@hackartisan hackartisan deleted the 301-docker-locally branch January 29, 2025 20:26
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.

cannot run docker container locally
2 participants