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

Just docker configuration #142

Closed
bitchecker opened this issue Dec 21, 2024 · 3 comments
Closed

Just docker configuration #142

bitchecker opened this issue Dec 21, 2024 · 3 comments

Comments

@bitchecker
Copy link
Contributor

Describe the bug
Hi,
will be great to have some documentation on how to run just the application instead of the entire stack as container.

Maybe for k8s deployment or simple "docker server" with dedicated databases already running.

@Clivern
Copy link
Owner

Clivern commented Dec 21, 2024

I think something like this should work

$ docker run -d \
  --name lynx \
  --restart unless-stopped \
  -p 4000:4000 \
  -e APP_NAME=Lynx \
  -e APP_PORT=4000 \
  -e APP_SECRET=koPmu7TJCwD8mttV9vgWUeU7iuu/zTPOR3sX4UalM9KkYEVGPfyi0PeTVzu1TT8C \
  -e APP_HOST=localhost \
  -e APP_HTTP_SCHEMA=http \
  -e DB_USERNAME=doadmin \
  -e DB_PASSWORD=AVNS_QYES3UaJRovCIfBOB93 \
  -e DB_HOSTNAME=db-postgresql-ams3-41583-do-user-1532625-0.e.db.ondigitalocean.com \
  -e DB_DATABASE=lexi \
  -e DB_PORT=25060 \
  -e DB_SSL=on \
  -e DB_CA_CERTFILE_PATH=/app/ca-certificate.crt \
  -e MIX_ENV=prod \
  -v /root/ca-certificate.crt:/app/ca-certificate.crt \
  clivern/lynx:0.12.7 sh -c "/app/bin/migrate && /app/bin/server"

@bitchecker
Copy link
Contributor Author

Hi @Clivern,
thanks for reply, and sorry for delay!

The options that you provided works, but what I found is "strange":

  • Container needs double ram compared with direct build
  • I can see that the migration phase works (so I can see tables on database) but If I try to reach the application I get "Internal Server Error" because logs are reporting timeout on database.

It's really strange, this behaviour. If it's able to create tables and everything is needed, why after that I get timeouts? 🤔

@Clivern
Copy link
Owner

Clivern commented Dec 28, 2024

Hi @Clivern, thanks for reply, and sorry for delay!

The options that you provided works, but what I found is "strange":

  • Container needs double ram compared with direct build
  • I can see that the migration phase works (so I can see tables on database) but If I try to reach the application I get "Internal Server Error" because logs are reporting timeout on database.

It's really strange, this behaviour. If it's able to create tables and everything is needed, why after that I get timeouts? 🤔

In my opinion, it should work in all cases. I tested it with local postgresql, and dockerized db and managed postgresql. they all work.

Anyways if you see these issues, please share the log records. it can help to identify the root cause.

@Clivern Clivern closed this as not planned Won't fix, can't repro, duplicate, stale Jan 24, 2025
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