Closed KamillaPup closed 2 months ago
You didn't set the PORT= environment variable in your compose config. This environment is only used in prod mode. Dev mode uses this: https://github.com/philomena-dev/philomena/blob/master/config/dev.exs#L13
Thanks! So if web runs on 8080 what should I run the app on? I currently have a reverse docker proxy forwarding 8080 to 80/443.
Also can I hire you? I'm not confident in my ability to move content over lol.
I set it to port 4000 like the link says and also tried 80 and 443 and they all cause the following error:
ERROR: for d110a045c166_philomena_app_1 'ContainerConfig'
ERROR: for app 'ContainerConfig'
Traceback (most recent call last):
File "/usr/bin/docker-compose", line 33, in <module>
sys.exit(load_entry_point('docker-compose==1.29.2', 'console_scripts', 'docker-compose')())
File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 81, in main
command_func()
File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 203, in perform_command
handler(command, command_options)
File "/usr/lib/python3/dist-packages/compose/metrics/decorator.py", line 18, in wrapper
result = fn(*args, **kwargs)
File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 1186, in up
to_attach = up(False)
File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 1166, in up
return self.project.up(
File "/usr/lib/python3/dist-packages/compose/project.py", line 697, in up
results, errors = parallel.parallel_execute(
File "/usr/lib/python3/dist-packages/compose/parallel.py", line 108, in parallel_execute
raise error_to_reraise
File "/usr/lib/python3/dist-packages/compose/parallel.py", line 206, in producer
result = func(obj)
File "/usr/lib/python3/dist-packages/compose/project.py", line 679, in do
return service.execute_convergence_plan(
File "/usr/lib/python3/dist-packages/compose/service.py", line 579, in execute_convergence_plan
return self._execute_convergence_recreate(
File "/usr/lib/python3/dist-packages/compose/service.py", line 499, in _execute_convergence_recreate
containers, errors = parallel_execute(
File "/usr/lib/python3/dist-packages/compose/parallel.py", line 108, in parallel_execute
raise error_to_reraise
File "/usr/lib/python3/dist-packages/compose/parallel.py", line 206, in producer
result = func(obj)
File "/usr/lib/python3/dist-packages/compose/service.py", line 494, in recreate
return self.recreate_container(
File "/usr/lib/python3/dist-packages/compose/service.py", line 612, in recreate_container
new_container = self.create_container(
File "/usr/lib/python3/dist-packages/compose/service.py", line 330, in create_container
container_options = self._get_container_create_options(
File "/usr/lib/python3/dist-packages/compose/service.py", line 921, in _get_container_create_options
container_options, override_options = self._build_container_volume_options(
File "/usr/lib/python3/dist-packages/compose/service.py", line 960, in _build_container_volume_options
binds, affinity = merge_volume_bindings(
File "/usr/lib/python3/dist-packages/compose/service.py", line 1548, in merge_volume_bindings
old_volumes, old_mounts = get_container_data_volumes(
File "/usr/lib/python3/dist-packages/compose/service.py", line 1579, in get_container_data_volumes
container.image_config['ContainerConfig'].get('Volumes') or {}
KeyError: 'ContainerConfig'
Ideally you probably want to expose the web container on ports 80 and 443 and have it doing TLS termination (which is out of the scope of this project), and have nginx forward requests on the internal network to the app running on whatever other port you like by setting the PORT envvar and modifying the port nginx uses to find the app.
Moving files to object storage can be done with this mix task
Since you are using a new version of docker, you should use docker compose
instead of docker-compose
. I've updated the documentation to reflect this. This should fix the issue with KeyError: 'ContainerConfig'
.
Okay that got it mostly but I'm still missing env variables... How many more are there and what is a secret key base?
** (System.EnvError) could not fetch environment variable "SECRET_KEY_BASE" because it is not set
app-1 | (elixir 1.16.1) lib/system.ex:721: System.fetch_env!/1
app-1 | /srv/philomena/config/runtime.exs:135: (file)
app-1 | (stdlib 5.2) erl_eval.erl:750: :erl_eval.do_apply/7
app-1 | (stdlib 5.2) erl_eval.erl:1026: :erl_eval.expr_list/7
app-1 | (stdlib 5.2) erl_eval.erl:292: :erl_eval.expr/6
app-1 | (stdlib 5.2) erl_eval.erl:282: :erl_eval.expr/6
app-1 | (stdlib 5.2) erl_eval.erl:283: :erl_eval.expr/6
app-1 exited with code 1
secret_key_base is used to encrypt and sign cookies for the application endpoint.
server is used to determine whether to start the server (generally you will want to set this to true, it is separated from the application to allow for running cron jobs without starting it)
Would secret_key_base be a 64 character salt string or just the hostname or something similar?
You can generate a new one with mix phx.gen.secret
.
I've had to move to a new server and switched to prod mode but the first step was to build a virgin philomena from the latest version then move data over.
Sadly, I keep getting this error when doing docker-compose up
I'm not sure how it's not set? I'm including my docker-compose.yml with salts and private info redacted.
Later on, I need to migrate the existing thumbs and database to this install and not sure how to do that. Ideally, I'd like to host all posts on Wasabi... also no clue lol.