Skip to content

Share common docker-compose.yml configurations (PROD and DEV enviroments)#79

Open
Raruto wants to merge 76 commits intodevfrom
single-compose-file
Open

Share common docker-compose.yml configurations (PROD and DEV enviroments)#79
Raruto wants to merge 76 commits intodevfrom
single-compose-file

Conversation

@Raruto
Copy link
Copy Markdown
Member

@Raruto Raruto commented Sep 27, 2022

List of changes:

  • remove docker-compose-consumer.yml (replaced by: docker-compose.yml)
  • remove docker-compose-consumer-dev.yml (replaced by: docker-compose.yml)
  • remove scripts/docker-consumer-entrypoint.sh (replaced by: docker-entrypoint.sh)
  • remove scripts/docker-consumer-dev.sh (replaced by: docker-entrypoint.sh)
  • add new makefile rule: make help (list available commands)
  • add new enviroment variable within .env.example (G3WSUITE_RUN_HUEY) in order to enable batch processing
  • add new service within docker-compose.yml (g3w-suite-consumer)
  • add new service within docker-compose.yml (dev-server)
  • update scripts/docker-entrypoint.sh in order to support gunicorn.conf.py configuration file (PROD and DEV server)
  • update README.md instructions related to "batch processing" and "development" usage

How to test

To test the changes from this PR, add the following to your .env file:

SCRIPTS_VOLUME=./scripts:/scripts # TEMPORARY: just to preview PR #79 (before merge)

And then run:

make reload ENV=prod

# 👉 same as: docker compose up -d 

If tou want to test debugpy integration (eg. to inspect batch processing), update your .env file:

G3WSUITE_RUN_HUEY=True

Reload containers:

make reload ENV=prod

# 👉 same as: docker compose up -d 

Go to your local "g3w-admin" repository and attach the debugger:

# g3w-admin/.vscode/launch.json
{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "G3W Gunicorn: Attach",
      "type": "debugpy",
      "request": "attach",
      "connect": {
        "host": "localhost",
        "port": 5678
      },
      "pathMappings": [
        {
          "localRoot": "${workspaceFolder}/g3w-admin",
          "remoteRoot": "/code/g3w-admin"
        }
      ],
      "django": true
    }
  ],
}
image

Closes: #66

Closes: #150

- remove `docker-compose-consumer.yml`
- add `G3WSUITE_RUN_HUEY` enviroment variable within `.env.example` (batch processing)
- add `g3w-suite-consumer` within `docker-compose.yml`
- refactor `docker-compose-consumer-dev.yml`  in order to extend the base `docker-compose.yml`
- remove `scripts/docker-entrypoint-dev.sh`
- add support for `gunicorn.conf.py` within `scripts/docker-entrypoint.sh` (in order to share same server in various enviroments: PROD / DEV)
- refactor `scripts/docker-consumer-entrypoint.sh` (ref. `G3WSUITE_RUN_HUEY`)
- update `README.md` instructions related to batch processing usage
- update `docker-compose.yml` version from `v3` to `v3.4`
@Raruto Raruto added the refactoring Anything which could result in a API change label Sep 27, 2022
@Raruto Raruto changed the title Share common docker-compose.yml configurations (PROD / DEV) Share common docker-compose.yml configurations (PROD and DEV enviroments) Sep 27, 2022
Comment thread scripts/docker-entrypoint.sh Outdated
Comment thread docker-compose.yml Outdated
- FRONTEND
- G3WSUITE_GUNICORN_MAX_REQUESTS
- G3WSUITE_GUNICORN_NUM_WORKERS
- G3WSUITE_GUNICORN_TIMEOUT
Copy link
Copy Markdown
Member Author

@Raruto Raruto Sep 27, 2022

Choose a reason for hiding this comment

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

Check if the huey service requires setting a different / greater value for the timeout (ref: G3WSUITE_GUNICORN_TIMEOUT).

Comment thread README.md Outdated
Comment thread scripts/docker-entrypoint.sh Outdated
Comment thread docker-compose-dev.yml Outdated
@Raruto Raruto mentioned this pull request Dec 30, 2022
1 task
Raruto added a commit to g3w-suite/g3w-client that referenced this pull request Feb 7, 2023
…ProjectsRegistry~createProject(projectConfig)`

Start addressing: #67

As a result of: #150 we intend to bring the development environment ever closer to the production one.

Related to: #89, #292 and g3w-suite/g3w-suite-docker#79
@Raruto
Copy link
Copy Markdown
Member Author

Raruto commented Apr 24, 2026

@wlorenzetti To test the changes of this PR, add the following to your .env file:

SCRIPTS_VOLUME=./scripts:/scripts # TEMPORARY: just to preview PR #79 (before merge)

And then run:

make reload ENV=prod

# 👉 same as: docker compose up -d 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactoring Anything which could result in a API change

Projects

None yet

3 participants