Skip to content

Fix: Docker Setup #980

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

Merged
merged 11 commits into from
Feb 26, 2025
Merged

Fix: Docker Setup #980

merged 11 commits into from
Feb 26, 2025

Conversation

danielmbrasil
Copy link
Member

@danielmbrasil danielmbrasil commented Oct 30, 2024

What this PR do ?

Updates the Docker setup. The application no longer is run inside a Docker container. Now, it's possible to run the application infrastructure (Redis, Postgres, Memcached) in containers, while running the application itself on your machine.

Related Issues

Fixes #930.
Closes #873 (deprecated)

Screenshots (if applicable)

Additional Notes (if any)

worker: bundle exec sidekiq -C config/sidekiq.yml
vite: bin/vite dev
Copy link
Member Author

Choose a reason for hiding this comment

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

If we start a vite process using Foreman, the translations break in the front-end (#978). As far as I could tell, Vite is already started when you run the Rails server, so I don't think this separate process is needed. If confirmed as unnecessary, #978 can be closed.

Copy link
Contributor

Choose a reason for hiding this comment

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

There's this issue related to the translations stuff. We can investigate later. In production this problem doesn't exist. Just in development.

Copy link
Member Author

Choose a reason for hiding this comment

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

The production Procfile does not start a new process for Vite. So, I believe that by removing this process that issue has been fixed.

worker: bundle exec sidekiq -C config/sidekiq.yml
vite: bin/vite dev
pusherfake: pusher-fake -i ${PUSHER_APP_ID:-123456} --socket-host 0.0.0.0 --socket-port ${PUSHER_WS_PORT:-45449} --web-host 0.0.0.0 --web-port ${PUSHER_PORT:-8888} -k ${PUSHER_APP_KEY:-centralakey} -s ${PUSHER_APP_SECRET:-centralsecret}
pusherfake: PUSHER_FAKE=1 pusher-fake -i ${PUSHER_APP_ID:-123456} --socket-host 0.0.0.0 --socket-port ${PUSHER_WS_PORT:-45449} --web-host 0.0.0.0 --web-port ${PUSHER_PORT:-8888} -k ${PUSHER_APP_KEY:-centralakey} -s ${PUSHER_APP_SECRET:-centralsecret}
Copy link
Member Author

Choose a reason for hiding this comment

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

There is an annoying issue with this process that looks to be a bug in Foreman. Foreman sends a SIGTERM to all child processes and then they are terminated. However, for pusher-fake specifically, the resources are not fully released by the process and it keeps the port 8888 busy. I couldn't figure out how to solve this, if you have any suggestion I'd appreciate it. For now, you can manually kill the process after exiting Foreman.

Copy link
Contributor

Choose a reason for hiding this comment

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

Created this issue to investigate later.

Comment on lines -4 to -9
nginx-proxy:
image: jwilder/nginx-proxy
ports:
- "80:80"
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
Copy link
Member Author

Choose a reason for hiding this comment

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

Since the application is no longer running on a Docker container, we can no longer bind the Nginx proxy to the application web server, so removing this service.

Comment on lines 18 to +21
adminer:
image: adminer:4.8.1
environment:
- VIRTUAL_HOST=adminer.cm42-central.localhost
ports:
- 8080:8080
Copy link
Member Author

Choose a reason for hiding this comment

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

Is this still needed?

Copy link
Contributor

@wrspada02 wrspada02 Feb 24, 2025

Choose a reason for hiding this comment

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

We can leave this for now. Just admin front-end to handle database stuff. We might remove this in the future.

Copy link
Collaborator

@HeitorMC HeitorMC left a comment

Choose a reason for hiding this comment

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

It always makes me happy to see your PR's @danielmbrasil 😄

I used the changes from this pr to help @julialbq with her setup 👍

Overall, LGTM :shipit:

If you want to, we can join forces to investigate this pusher-fake later on 🤙

@wrspada02
Copy link
Contributor

We noticed there were e2e tests that haven't worked. Opened this issue

@wrspada02
Copy link
Contributor

Besides, opened this issue to enhance Cypress E2E cover

@talyssonoc talyssonoc merged commit 7b7b847 into master Feb 26, 2025
4 checks passed
@talyssonoc talyssonoc deleted the fix/docker-setup branch February 26, 2025 17:55
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.

Fix Dockerfile setup
5 participants