-
Notifications
You must be signed in to change notification settings - Fork 22
fix(compose-file):updated mysql version, added health chk, volume #93
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
base: main
Are you sure you want to change the base?
Changes from all commits
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 | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,32 +1,45 @@ | ||||||||||||||||||||||||||||||
| version: '3' | ||||||||||||||||||||||||||||||
| services: | ||||||||||||||||||||||||||||||
| db_mysql: | ||||||||||||||||||||||||||||||
| image: mysql:5.7 | ||||||||||||||||||||||||||||||
| image: mysql:8.0.35 | ||||||||||||||||||||||||||||||
| ports: | ||||||||||||||||||||||||||||||
| - '3306:3306' | ||||||||||||||||||||||||||||||
| restart: always | ||||||||||||||||||||||||||||||
| env_file: | ||||||||||||||||||||||||||||||
| - .env.docker | ||||||||||||||||||||||||||||||
| environment: | ||||||||||||||||||||||||||||||
| MYSQL_ROOT_PASSWORD: password | ||||||||||||||||||||||||||||||
| volumes: | ||||||||||||||||||||||||||||||
| - mysql_data:/var/lib/mysql | ||||||||||||||||||||||||||||||
| healthcheck: | ||||||||||||||||||||||||||||||
| test: ["CMD", "mysqladmin", "ping", "-h", "localhost"] | ||||||||||||||||||||||||||||||
| interval: 10s | ||||||||||||||||||||||||||||||
| timeout: 5s | ||||||||||||||||||||||||||||||
| retries: 5 | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| redis: | ||||||||||||||||||||||||||||||
| image: 'redis:alpine' | ||||||||||||||||||||||||||||||
| ports: | ||||||||||||||||||||||||||||||
| - '6379:6379' | ||||||||||||||||||||||||||||||
| command: ['redis-server', '--bind', 'redis', '--port', '6379'] | ||||||||||||||||||||||||||||||
| command: ['redis-server', '--bind', '0.0.0.0', '--port', '6379'] | ||||||||||||||||||||||||||||||
| healthcheck: | ||||||||||||||||||||||||||||||
| test: ["CMD", "redis-cli", "ping"] | ||||||||||||||||||||||||||||||
| interval: 10s | ||||||||||||||||||||||||||||||
| timeout: 5s | ||||||||||||||||||||||||||||||
| retries: 5 | ||||||||||||||||||||||||||||||
|
Comment on lines
+21
to
+26
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. Redis is exposed to the host without authentication.
Additionally, same ⚙️ Proposed fix (auth + start_period) command: ['redis-server', '--bind', '0.0.0.0', '--port', '6379']
+ # command: ['redis-server', '--bind', '0.0.0.0', '--port', '6379', '--requirepass', '${REDIS_PASSWORD}']
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
+ start_period: 10s📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| app: | ||||||||||||||||||||||||||||||
| depends_on: | ||||||||||||||||||||||||||||||
| - redis | ||||||||||||||||||||||||||||||
| - db_mysql | ||||||||||||||||||||||||||||||
| build: | ||||||||||||||||||||||||||||||
| context: . | ||||||||||||||||||||||||||||||
| args: | ||||||||||||||||||||||||||||||
| ENVIRONMENT_NAME: .docker | ||||||||||||||||||||||||||||||
| BUILD_NAME: docker | ||||||||||||||||||||||||||||||
| restart: always | ||||||||||||||||||||||||||||||
| ports: | ||||||||||||||||||||||||||||||
| - 9000:9000 | ||||||||||||||||||||||||||||||
| env_file: | ||||||||||||||||||||||||||||||
| - .env.docker | ||||||||||||||||||||||||||||||
| volumes: | ||||||||||||||||||||||||||||||
| mysql_data: | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| # app: | ||||||||||||||||||||||||||||||
| # depends_on: | ||||||||||||||||||||||||||||||
| # - redis | ||||||||||||||||||||||||||||||
| # - db_mysql | ||||||||||||||||||||||||||||||
| # build: | ||||||||||||||||||||||||||||||
| # context: . | ||||||||||||||||||||||||||||||
| # args: | ||||||||||||||||||||||||||||||
| # ENVIRONMENT_NAME: .docker | ||||||||||||||||||||||||||||||
| # BUILD_NAME: docker | ||||||||||||||||||||||||||||||
| # restart: always | ||||||||||||||||||||||||||||||
| # ports: | ||||||||||||||||||||||||||||||
| # - 9000:9000 | ||||||||||||||||||||||||||||||
| # env_file: | ||||||||||||||||||||||||||||||
| # - .env.docker | ||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Redis service is configured to bind to
0.0.0.0and is exposed on port 6379 to the host. Since Redis does not have authentication enabled by default, this allows anyone with network access to the host to connect to the Redis instance. This can lead to unauthorized data access, modification, or even remote code execution on the container. It is highly recommended to enable authentication if the port must be exposed to the host.