-
Notifications
You must be signed in to change notification settings - Fork 65
Merge web and gateway images; split up server and celery; enable docker to be run as non-root #234
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
Changes from all commits
4d6329f
3d79e5b
c2db9e3
50a6045
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -160,3 +160,7 @@ GLOBAL_STORAGE=10737418240 | |
| # GLOBAL_WRITE False | ||
|
|
||
| # GLOBAL_ADMIN False | ||
|
|
||
| # Gunicorn server socket | ||
|
|
||
| PORT=5000 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| version: "3.7" | ||
|
|
||
| services: | ||
| server-gunicorn: | ||
| image: server-gunicorn | ||
| build: | ||
| context: ./server | ||
| dockerfile: Dockerfile | ||
| celery-beat: | ||
| image: celery-beat | ||
| build: | ||
| context: ./server | ||
| dockerfile: Dockerfile | ||
| celery-worker: | ||
| image: celery-worker | ||
| build: | ||
| context: ./server | ||
| dockerfile: Dockerfile | ||
| web: | ||
| image: merginmaps-frontend | ||
| build: | ||
| context: ./web-app | ||
| dockerfile: Dockerfile |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,7 +20,7 @@ services: | |
| restart: always | ||
| networks: | ||
| - merginmaps | ||
| server: | ||
| server-gunicorn: | ||
| image: lutraconsulting/merginmaps-backend:2024.2.2 | ||
| container_name: merginmaps-server | ||
| restart: always | ||
|
|
@@ -32,24 +32,48 @@ services: | |
| depends_on: | ||
| - db | ||
| - redis | ||
| command: [ "gunicorn --config config.py application:application" ] | ||
| networks: | ||
| - merginmaps | ||
| celery-beat: | ||
| image: lutraconsulting/merginmaps-backend:2024.2.2 | ||
| container_name: celery-beat | ||
| env_file: | ||
| - .prod.env | ||
| depends_on: | ||
| - redis | ||
| - server-gunicorn | ||
| command: [ "celery -A application.celery beat --loglevel=info" ] | ||
| networks: | ||
| - merginmaps | ||
| celery-worker: | ||
| image: lutraconsulting/merginmaps-backend:2024.2.2 | ||
| container_name: celery-worker | ||
| env_file: | ||
| - .prod.env | ||
| depends_on: | ||
| - redis | ||
| - server-gunicorn | ||
| - celery-beat | ||
| command: [ "celery -A application.celery worker --loglevel=info" ] | ||
| networks: | ||
| - merginmaps | ||
| web: | ||
| image: lutraconsulting/merginmaps-frontend:2024.2.2 | ||
| container_name: merginmaps-web | ||
| restart: always | ||
| depends_on: | ||
| - server | ||
| - server-gunicorn | ||
| links: | ||
| - db | ||
| networks: | ||
| - merginmaps | ||
| proxy: | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. for production is more reasonable to have gateway. Frontend is just one container in stack ... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @MarcelGeo I actually disagree on this point, could we discuss it a bit (here or in a meet)? Having 2 nginx servers, one for routing and one for statically serving the webapp actually uses more ram (you need 2 containers), degrades (minimally) the services as an additional request is sent and processed by the second nginx, and makes the deployment on k8s more cumbersome.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it depends on deployment type, I know there are some users already using host nginx as both, proxy and for TLS termination. Also there are users using dockerized proxy as stated in current docker-compose example, so I am bit worried about such changes for inexperienced users. I agree it could be merged and you guys can certainly do that for your k8s deployments but I would prefer here in public repo to keep is as is even if not optimal. We can instead maybe provide some optimization hints instead?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree with @varmar05 ... It should be useful to have volume for web-app (a.k.a dashboard) nginx config and upgrade It in custom deployment. |
||
| image: nginx | ||
| image: nginxinc/nginx-unprivileged:1.25.5 | ||
| container_name: merginmaps-proxy | ||
| restart: always | ||
| ports: | ||
| - "8080:80" | ||
| - "8080:8080" | ||
| volumes: | ||
| - ./projects:/data # map data dir to host | ||
| - ./nginx.conf:/etc/nginx/conf.d/default.conf | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| server { | ||
| listen 80; | ||
| listen [::]:80; | ||
| listen 8080; | ||
| listen [::]:8080; | ||
| server_name _; | ||
|
|
||
| client_max_body_size 4G; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.