feat: ability to create a project #9
@ -13,7 +13,6 @@ services:
|
|||||||
- ./Dioxus.toml:/srv/app/Dioxus.toml
|
- ./Dioxus.toml:/srv/app/Dioxus.toml
|
||||||
- ./package.json:/srv/app/package.json
|
- ./package.json:/srv/app/package.json
|
||||||
- ./package-lock.json:/srv/app/package-lock.json
|
- ./package-lock.json:/srv/app/package-lock.json
|
||||||
- ./tailwind.config.js:/srv/app/tailwind.config.js
|
|
||||||
restart: always
|
restart: always
|
||||||
ports: [ "8000:8000" ]
|
ports: [ "8000:8000" ]
|
||||||
|
|||||||
depends_on: [ "db" ]
|
depends_on: [ "db" ]
|
||||||
|
@ -20,4 +20,4 @@ HEALTHCHECK CMD curl --fail http://localhost:8000 || exit 1
|
|||||||
![]() Consolidate Multiple consecutive
ToolsHadolint
**Consolidate `RUN` instructions for efficiency.**
Multiple consecutive `RUN` instructions can be consolidated to reduce the number of layers in the Docker image.
```dockerfile
RUN rustup target add wasm32-unknown-unknown && \
cargo install dioxus-cli diesel_cli
```
<details>
<summary>Tools</summary>
<details>
<summary>Hadolint</summary><blockquote>
[info] 4-4: Multiple consecutive `RUN` instructions. Consider consolidation.
(DL3059)
</blockquote></details>
</details>
<!-- This is an auto-generated comment by CodeRabbit -->
![]() Pin versions in It's recommended to pin versions in
ToolsHadolint
Clean up To reduce the image size, delete the
ToolsHadolint
Use Using
ToolsHadolint
**Pin versions in `apt-get install`.**
It's recommended to pin versions in `apt-get install` to ensure consistent builds.
```dockerfile
RUN apt-get update && apt-get install -y nodejs=12.22.12 npm=6.14.15 supervisor=4.2.2
```
<details>
<summary>Tools</summary>
<details>
<summary>Hadolint</summary><blockquote>
[warning] 5-5: Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`
(DL3008)
---
[info] 5-5: Delete the apt-get lists after installing something
(DL3009)
---
[info] 5-5: Avoid additional packages by specifying `--no-install-recommends`
(DL3015)
</blockquote></details>
</details>
<!-- This is an auto-generated comment by CodeRabbit -->
---
**Clean up `apt-get` lists after installation.**
To reduce the image size, delete the `apt-get` lists after installing packages.
```dockerfile
RUN apt-get update && apt-get install -y --no-install-recommends nodejs npm supervisor && \
rm -rf /var/lib/apt/lists/*
```
<details>
<summary>Tools</summary>
<details>
<summary>Hadolint</summary><blockquote>
[warning] 5-5: Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`
(DL3008)
---
[info] 5-5: Delete the apt-get lists after installing something
(DL3009)
---
[info] 5-5: Avoid additional packages by specifying `--no-install-recommends`
(DL3015)
</blockquote></details>
</details>
<!-- This is an auto-generated comment by CodeRabbit -->
---
**Use `--no-install-recommends` to avoid unnecessary packages.**
Using `--no-install-recommends` can help avoid installing additional packages that are not needed.
```dockerfile
RUN apt-get update && apt-get install -y --no-install-recommends nodejs npm supervisor
```
<details>
<summary>Tools</summary>
<details>
<summary>Hadolint</summary><blockquote>
[warning] 5-5: Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`
(DL3008)
---
[info] 5-5: Delete the apt-get lists after installing something
(DL3009)
---
[info] 5-5: Avoid additional packages by specifying `--no-install-recommends`
(DL3015)
</blockquote></details>
</details>
<!-- This is an auto-generated comment by CodeRabbit -->
![]() Consolidate Multiple consecutive
ToolsHadolint
**Consolidate `RUN` instructions for efficiency.**
Multiple consecutive `RUN` instructions can be consolidated to reduce the number of layers in the Docker image.
```dockerfile
RUN rustup target add wasm32-unknown-unknown && \
cargo install dioxus-cli diesel_cli
```
<details>
<summary>Tools</summary>
<details>
<summary>Hadolint</summary><blockquote>
[info] 4-4: Multiple consecutive `RUN` instructions. Consider consolidation.
(DL3059)
</blockquote></details>
</details>
<!-- This is an auto-generated comment by CodeRabbit -->
![]() Pin versions in It's recommended to pin versions in
ToolsHadolint
Clean up To reduce the image size, delete the
ToolsHadolint
Use Using
ToolsHadolint
**Pin versions in `apt-get install`.**
It's recommended to pin versions in `apt-get install` to ensure consistent builds.
```dockerfile
RUN apt-get update && apt-get install -y nodejs=12.22.12 npm=6.14.15 supervisor=4.2.2
```
<details>
<summary>Tools</summary>
<details>
<summary>Hadolint</summary><blockquote>
[warning] 5-5: Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`
(DL3008)
---
[info] 5-5: Delete the apt-get lists after installing something
(DL3009)
---
[info] 5-5: Avoid additional packages by specifying `--no-install-recommends`
(DL3015)
</blockquote></details>
</details>
<!-- This is an auto-generated comment by CodeRabbit -->
---
**Clean up `apt-get` lists after installation.**
To reduce the image size, delete the `apt-get` lists after installing packages.
```dockerfile
RUN apt-get update && apt-get install -y --no-install-recommends nodejs npm supervisor && \
rm -rf /var/lib/apt/lists/*
```
<details>
<summary>Tools</summary>
<details>
<summary>Hadolint</summary><blockquote>
[warning] 5-5: Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`
(DL3008)
---
[info] 5-5: Delete the apt-get lists after installing something
(DL3009)
---
[info] 5-5: Avoid additional packages by specifying `--no-install-recommends`
(DL3015)
</blockquote></details>
</details>
<!-- This is an auto-generated comment by CodeRabbit -->
---
**Use `--no-install-recommends` to avoid unnecessary packages.**
Using `--no-install-recommends` can help avoid installing additional packages that are not needed.
```dockerfile
RUN apt-get update && apt-get install -y --no-install-recommends nodejs npm supervisor
```
<details>
<summary>Tools</summary>
<details>
<summary>Hadolint</summary><blockquote>
[warning] 5-5: Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`
(DL3008)
---
[info] 5-5: Delete the apt-get lists after installing something
(DL3009)
---
[info] 5-5: Avoid additional packages by specifying `--no-install-recommends`
(DL3015)
</blockquote></details>
</details>
<!-- This is an auto-generated comment by CodeRabbit -->
![]() Avoid using For security reasons, it's recommended to avoid running containers as the root user. Consider switching to a non-root user.
ToolsHadolint
**Avoid using `USER root` as the last instruction.**
For security reasons, it's recommended to avoid running containers as the root user. Consider switching to a non-root user.
```dockerfile
# Example: Create a non-root user and switch to it
RUN useradd -ms /bin/bash appuser
USER appuser
```
<details>
<summary>Tools</summary>
<details>
<summary>Hadolint</summary><blockquote>
[warning] 15-15: Last USER should not be root
(DL3002)
</blockquote></details>
</details>
<!-- This is an auto-generated comment by CodeRabbit -->
![]() Avoid using For security reasons, it's recommended to avoid running containers as the root user. Consider switching to a non-root user.
ToolsHadolint
**Avoid using `USER root` as the last instruction.**
For security reasons, it's recommended to avoid running containers as the root user. Consider switching to a non-root user.
```dockerfile
# Example: Create a non-root user and switch to it
RUN useradd -ms /bin/bash appuser
USER appuser
```
<details>
<summary>Tools</summary>
<details>
<summary>Hadolint</summary><blockquote>
[warning] 15-15: Last USER should not be root
(DL3002)
</blockquote></details>
</details>
<!-- This is an auto-generated comment by CodeRabbit -->
![]() Consolidate Consolidate the
ToolsHadolint
**Consolidate `RUN` instructions for efficiency.**
Consolidate the `RUN` instructions to reduce the number of layers in the Docker image.
```dockerfile
RUN chown -R 1000:1000 /srv/app /usr/local/cargo /.local/share/dioxus && \
mkdir -p /.local/share/dioxus
```
<details>
<summary>Tools</summary>
<details>
<summary>Hadolint</summary><blockquote>
[info] 15-15: Multiple consecutive `RUN` instructions. Consider consolidation.
(DL3059)
---
[info] 16-16: Multiple consecutive `RUN` instructions. Consider consolidation.
(DL3059)
---
[info] 17-17: Multiple consecutive `RUN` instructions. Consider consolidation.
(DL3059)
</blockquote></details>
</details>
<!-- This is an auto-generated comment by CodeRabbit -->
![]() Consolidate Consolidate the
ToolsHadolint
**Consolidate `RUN` instructions for efficiency.**
Consolidate the `RUN` instructions to reduce the number of layers in the Docker image.
```dockerfile
RUN chown -R 1000:1000 /srv/app /usr/local/cargo /.local/share/dioxus && \
mkdir -p /.local/share/dioxus
```
<details>
<summary>Tools</summary>
<details>
<summary>Hadolint</summary><blockquote>
[info] 15-15: Multiple consecutive `RUN` instructions. Consider consolidation.
(DL3059)
---
[info] 16-16: Multiple consecutive `RUN` instructions. Consider consolidation.
(DL3059)
---
[info] 17-17: Multiple consecutive `RUN` instructions. Consider consolidation.
(DL3059)
</blockquote></details>
</details>
<!-- This is an auto-generated comment by CodeRabbit -->
![]() Use JSON notation for CMD instruction. Using JSON notation for the CMD instruction ensures better handling of arguments and prevents issues related to shell interpretation.
Committable suggestion
ToolsHadolint
**Use JSON notation for CMD instruction.**
Using JSON notation for the CMD instruction ensures better handling of arguments and prevents issues related to shell interpretation.
```diff
- CMD sh docker/dev/app/entrypoint.sh
+ CMD ["sh", "docker/dev/app/entrypoint.sh"]
```
<!-- suggestion_start -->
<details>
<summary>Committable suggestion</summary>
> :bangbang: **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
`````suggestion
CMD ["sh", "docker/dev/app/entrypoint.sh"]
`````
</details>
<!-- suggestion_end -->
<details>
<summary>Tools</summary>
<details>
<summary>Hadolint</summary><blockquote>
[warning] 23-23: Use arguments JSON notation for CMD and ENTRYPOINT arguments
(DL3025)
</blockquote></details>
</details>
<!-- This is an auto-generated comment by CodeRabbit -->
![]() Use JSON notation for CMD instruction. Using JSON notation for the CMD instruction ensures better handling of arguments and prevents issues related to shell interpretation.
Committable suggestion
ToolsHadolint
**Use JSON notation for CMD instruction.**
Using JSON notation for the CMD instruction ensures better handling of arguments and prevents issues related to shell interpretation.
```diff
- CMD sh docker/dev/app/entrypoint.sh
+ CMD ["sh", "docker/dev/app/entrypoint.sh"]
```
<!-- suggestion_start -->
<details>
<summary>Committable suggestion</summary>
> :bangbang: **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
`````suggestion
CMD ["sh", "docker/dev/app/entrypoint.sh"]
`````
</details>
<!-- suggestion_end -->
<details>
<summary>Tools</summary>
<details>
<summary>Hadolint</summary><blockquote>
[warning] 23-23: Use arguments JSON notation for CMD and ENTRYPOINT arguments
(DL3025)
</blockquote></details>
</details>
<!-- This is an auto-generated comment by CodeRabbit -->
|
|||||||
|
|
||||||
USER 1000:1000
|
USER 1000:1000
|
||||||
![]() Consider avoiding For security reasons, it's recommended to avoid running containers as the root user. Consider switching to a non-root user earlier in the Dockerfile.
**Consider avoiding `USER root` as the last instruction.**
For security reasons, it's recommended to avoid running containers as the root user. Consider switching to a non-root user earlier in the Dockerfile.
```dockerfile
# Example: Create a non-root user and switch to it
RUN useradd -ms /bin/bash appuser
USER appuser
```
<!-- This is an auto-generated comment by CodeRabbit -->
|
|||||||
|
|
||||||
CMD ["supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
|
CMD sh docker/dev/app/entrypoint.sh
|
||||||
![]() Consolidate Multiple consecutive
ToolsHadolint
**Consolidate `RUN` instructions for efficiency.**
Multiple consecutive `RUN` instructions can be consolidated to reduce the number of layers in the Docker image.
```dockerfile
RUN rustup target add wasm32-unknown-unknown && \
cargo install dioxus-cli diesel_cli
```
<details>
<summary>Tools</summary>
<details>
<summary>Hadolint</summary><blockquote>
[info] 4-4: Multiple consecutive `RUN` instructions. Consider consolidation.
(DL3059)
</blockquote></details>
</details>
<!-- This is an auto-generated comment by CodeRabbit -->
![]() Pin versions in It's recommended to pin versions in
ToolsHadolint
Clean up To reduce the image size, delete the
ToolsHadolint
Use Using
ToolsHadolint
**Pin versions in `apt-get install`.**
It's recommended to pin versions in `apt-get install` to ensure consistent builds.
```dockerfile
RUN apt-get update && apt-get install -y nodejs=12.22.12 npm=6.14.15 supervisor=4.2.2
```
<details>
<summary>Tools</summary>
<details>
<summary>Hadolint</summary><blockquote>
[warning] 5-5: Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`
(DL3008)
---
[info] 5-5: Delete the apt-get lists after installing something
(DL3009)
---
[info] 5-5: Avoid additional packages by specifying `--no-install-recommends`
(DL3015)
</blockquote></details>
</details>
<!-- This is an auto-generated comment by CodeRabbit -->
---
**Clean up `apt-get` lists after installation.**
To reduce the image size, delete the `apt-get` lists after installing packages.
```dockerfile
RUN apt-get update && apt-get install -y --no-install-recommends nodejs npm supervisor && \
rm -rf /var/lib/apt/lists/*
```
<details>
<summary>Tools</summary>
<details>
<summary>Hadolint</summary><blockquote>
[warning] 5-5: Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`
(DL3008)
---
[info] 5-5: Delete the apt-get lists after installing something
(DL3009)
---
[info] 5-5: Avoid additional packages by specifying `--no-install-recommends`
(DL3015)
</blockquote></details>
</details>
<!-- This is an auto-generated comment by CodeRabbit -->
---
**Use `--no-install-recommends` to avoid unnecessary packages.**
Using `--no-install-recommends` can help avoid installing additional packages that are not needed.
```dockerfile
RUN apt-get update && apt-get install -y --no-install-recommends nodejs npm supervisor
```
<details>
<summary>Tools</summary>
<details>
<summary>Hadolint</summary><blockquote>
[warning] 5-5: Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`
(DL3008)
---
[info] 5-5: Delete the apt-get lists after installing something
(DL3009)
---
[info] 5-5: Avoid additional packages by specifying `--no-install-recommends`
(DL3015)
</blockquote></details>
</details>
<!-- This is an auto-generated comment by CodeRabbit -->
![]() Avoid using For security reasons, it's recommended to avoid running containers as the root user. Consider switching to a non-root user.
ToolsHadolint
**Avoid using `USER root` as the last instruction.**
For security reasons, it's recommended to avoid running containers as the root user. Consider switching to a non-root user.
```dockerfile
# Example: Create a non-root user and switch to it
RUN useradd -ms /bin/bash appuser
USER appuser
```
<details>
<summary>Tools</summary>
<details>
<summary>Hadolint</summary><blockquote>
[warning] 15-15: Last USER should not be root
(DL3002)
</blockquote></details>
</details>
<!-- This is an auto-generated comment by CodeRabbit -->
![]() Consolidate Consolidate the
ToolsHadolint
**Consolidate `RUN` instructions for efficiency.**
Consolidate the `RUN` instructions to reduce the number of layers in the Docker image.
```dockerfile
RUN chown -R 1000:1000 /srv/app /usr/local/cargo /.local/share/dioxus && \
mkdir -p /.local/share/dioxus
```
<details>
<summary>Tools</summary>
<details>
<summary>Hadolint</summary><blockquote>
[info] 15-15: Multiple consecutive `RUN` instructions. Consider consolidation.
(DL3059)
---
[info] 16-16: Multiple consecutive `RUN` instructions. Consider consolidation.
(DL3059)
---
[info] 17-17: Multiple consecutive `RUN` instructions. Consider consolidation.
(DL3059)
</blockquote></details>
</details>
<!-- This is an auto-generated comment by CodeRabbit -->
![]() Use JSON notation for CMD instruction. Using JSON notation for the CMD instruction ensures better handling of arguments and prevents issues related to shell interpretation.
Committable suggestion
ToolsHadolint
**Use JSON notation for CMD instruction.**
Using JSON notation for the CMD instruction ensures better handling of arguments and prevents issues related to shell interpretation.
```diff
- CMD sh docker/dev/app/entrypoint.sh
+ CMD ["sh", "docker/dev/app/entrypoint.sh"]
```
<!-- suggestion_start -->
<details>
<summary>Committable suggestion</summary>
> :bangbang: **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
`````suggestion
CMD ["sh", "docker/dev/app/entrypoint.sh"]
`````
</details>
<!-- suggestion_end -->
<details>
<summary>Tools</summary>
<details>
<summary>Hadolint</summary><blockquote>
[warning] 23-23: Use arguments JSON notation for CMD and ENTRYPOINT arguments
(DL3025)
</blockquote></details>
</details>
<!-- This is an auto-generated comment by CodeRabbit -->
![]() Consolidate Multiple consecutive
ToolsHadolint
**Consolidate `RUN` instructions for efficiency.**
Multiple consecutive `RUN` instructions can be consolidated to reduce the number of layers in the Docker image.
```dockerfile
RUN rustup target add wasm32-unknown-unknown && \
cargo install dioxus-cli diesel_cli
```
<details>
<summary>Tools</summary>
<details>
<summary>Hadolint</summary><blockquote>
[info] 4-4: Multiple consecutive `RUN` instructions. Consider consolidation.
(DL3059)
</blockquote></details>
</details>
<!-- This is an auto-generated comment by CodeRabbit -->
![]() Pin versions in It's recommended to pin versions in
ToolsHadolint
Clean up To reduce the image size, delete the
ToolsHadolint
Use Using
ToolsHadolint
**Pin versions in `apt-get install`.**
It's recommended to pin versions in `apt-get install` to ensure consistent builds.
```dockerfile
RUN apt-get update && apt-get install -y nodejs=12.22.12 npm=6.14.15 supervisor=4.2.2
```
<details>
<summary>Tools</summary>
<details>
<summary>Hadolint</summary><blockquote>
[warning] 5-5: Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`
(DL3008)
---
[info] 5-5: Delete the apt-get lists after installing something
(DL3009)
---
[info] 5-5: Avoid additional packages by specifying `--no-install-recommends`
(DL3015)
</blockquote></details>
</details>
<!-- This is an auto-generated comment by CodeRabbit -->
---
**Clean up `apt-get` lists after installation.**
To reduce the image size, delete the `apt-get` lists after installing packages.
```dockerfile
RUN apt-get update && apt-get install -y --no-install-recommends nodejs npm supervisor && \
rm -rf /var/lib/apt/lists/*
```
<details>
<summary>Tools</summary>
<details>
<summary>Hadolint</summary><blockquote>
[warning] 5-5: Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`
(DL3008)
---
[info] 5-5: Delete the apt-get lists after installing something
(DL3009)
---
[info] 5-5: Avoid additional packages by specifying `--no-install-recommends`
(DL3015)
</blockquote></details>
</details>
<!-- This is an auto-generated comment by CodeRabbit -->
---
**Use `--no-install-recommends` to avoid unnecessary packages.**
Using `--no-install-recommends` can help avoid installing additional packages that are not needed.
```dockerfile
RUN apt-get update && apt-get install -y --no-install-recommends nodejs npm supervisor
```
<details>
<summary>Tools</summary>
<details>
<summary>Hadolint</summary><blockquote>
[warning] 5-5: Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`
(DL3008)
---
[info] 5-5: Delete the apt-get lists after installing something
(DL3009)
---
[info] 5-5: Avoid additional packages by specifying `--no-install-recommends`
(DL3015)
</blockquote></details>
</details>
<!-- This is an auto-generated comment by CodeRabbit -->
![]() Avoid using For security reasons, it's recommended to avoid running containers as the root user. Consider switching to a non-root user.
ToolsHadolint
**Avoid using `USER root` as the last instruction.**
For security reasons, it's recommended to avoid running containers as the root user. Consider switching to a non-root user.
```dockerfile
# Example: Create a non-root user and switch to it
RUN useradd -ms /bin/bash appuser
USER appuser
```
<details>
<summary>Tools</summary>
<details>
<summary>Hadolint</summary><blockquote>
[warning] 15-15: Last USER should not be root
(DL3002)
</blockquote></details>
</details>
<!-- This is an auto-generated comment by CodeRabbit -->
![]() Consolidate Consolidate the
ToolsHadolint
**Consolidate `RUN` instructions for efficiency.**
Consolidate the `RUN` instructions to reduce the number of layers in the Docker image.
```dockerfile
RUN chown -R 1000:1000 /srv/app /usr/local/cargo /.local/share/dioxus && \
mkdir -p /.local/share/dioxus
```
<details>
<summary>Tools</summary>
<details>
<summary>Hadolint</summary><blockquote>
[info] 15-15: Multiple consecutive `RUN` instructions. Consider consolidation.
(DL3059)
---
[info] 16-16: Multiple consecutive `RUN` instructions. Consider consolidation.
(DL3059)
---
[info] 17-17: Multiple consecutive `RUN` instructions. Consider consolidation.
(DL3059)
</blockquote></details>
</details>
<!-- This is an auto-generated comment by CodeRabbit -->
![]() Use JSON notation for CMD instruction. Using JSON notation for the CMD instruction ensures better handling of arguments and prevents issues related to shell interpretation.
Committable suggestion
ToolsHadolint
**Use JSON notation for CMD instruction.**
Using JSON notation for the CMD instruction ensures better handling of arguments and prevents issues related to shell interpretation.
```diff
- CMD sh docker/dev/app/entrypoint.sh
+ CMD ["sh", "docker/dev/app/entrypoint.sh"]
```
<!-- suggestion_start -->
<details>
<summary>Committable suggestion</summary>
> :bangbang: **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
`````suggestion
CMD ["sh", "docker/dev/app/entrypoint.sh"]
`````
</details>
<!-- suggestion_end -->
<details>
<summary>Tools</summary>
<details>
<summary>Hadolint</summary><blockquote>
[warning] 23-23: Use arguments JSON notation for CMD and ENTRYPOINT arguments
(DL3025)
</blockquote></details>
</details>
<!-- This is an auto-generated comment by CodeRabbit -->
|
|||||||
|
|||||||
![]() Consolidate Multiple consecutive
ToolsHadolint
**Consolidate `RUN` instructions for efficiency.**
Multiple consecutive `RUN` instructions can be consolidated to reduce the number of layers in the Docker image.
```dockerfile
RUN rustup target add wasm32-unknown-unknown && \
cargo install dioxus-cli diesel_cli
```
<details>
<summary>Tools</summary>
<details>
<summary>Hadolint</summary><blockquote>
[info] 4-4: Multiple consecutive `RUN` instructions. Consider consolidation.
(DL3059)
</blockquote></details>
</details>
<!-- This is an auto-generated comment by CodeRabbit -->
![]() Pin versions in It's recommended to pin versions in
ToolsHadolint
Clean up To reduce the image size, delete the
ToolsHadolint
Use Using
ToolsHadolint
**Pin versions in `apt-get install`.**
It's recommended to pin versions in `apt-get install` to ensure consistent builds.
```dockerfile
RUN apt-get update && apt-get install -y nodejs=12.22.12 npm=6.14.15 supervisor=4.2.2
```
<details>
<summary>Tools</summary>
<details>
<summary>Hadolint</summary><blockquote>
[warning] 5-5: Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`
(DL3008)
---
[info] 5-5: Delete the apt-get lists after installing something
(DL3009)
---
[info] 5-5: Avoid additional packages by specifying `--no-install-recommends`
(DL3015)
</blockquote></details>
</details>
<!-- This is an auto-generated comment by CodeRabbit -->
---
**Clean up `apt-get` lists after installation.**
To reduce the image size, delete the `apt-get` lists after installing packages.
```dockerfile
RUN apt-get update && apt-get install -y --no-install-recommends nodejs npm supervisor && \
rm -rf /var/lib/apt/lists/*
```
<details>
<summary>Tools</summary>
<details>
<summary>Hadolint</summary><blockquote>
[warning] 5-5: Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`
(DL3008)
---
[info] 5-5: Delete the apt-get lists after installing something
(DL3009)
---
[info] 5-5: Avoid additional packages by specifying `--no-install-recommends`
(DL3015)
</blockquote></details>
</details>
<!-- This is an auto-generated comment by CodeRabbit -->
---
**Use `--no-install-recommends` to avoid unnecessary packages.**
Using `--no-install-recommends` can help avoid installing additional packages that are not needed.
```dockerfile
RUN apt-get update && apt-get install -y --no-install-recommends nodejs npm supervisor
```
<details>
<summary>Tools</summary>
<details>
<summary>Hadolint</summary><blockquote>
[warning] 5-5: Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`
(DL3008)
---
[info] 5-5: Delete the apt-get lists after installing something
(DL3009)
---
[info] 5-5: Avoid additional packages by specifying `--no-install-recommends`
(DL3015)
</blockquote></details>
</details>
<!-- This is an auto-generated comment by CodeRabbit -->
![]() Consolidate Multiple consecutive
ToolsHadolint
**Consolidate `RUN` instructions for efficiency.**
Multiple consecutive `RUN` instructions can be consolidated to reduce the number of layers in the Docker image.
```dockerfile
RUN rustup target add wasm32-unknown-unknown && \
cargo install dioxus-cli diesel_cli
```
<details>
<summary>Tools</summary>
<details>
<summary>Hadolint</summary><blockquote>
[info] 4-4: Multiple consecutive `RUN` instructions. Consider consolidation.
(DL3059)
</blockquote></details>
</details>
<!-- This is an auto-generated comment by CodeRabbit -->
![]() Pin versions in It's recommended to pin versions in
ToolsHadolint
Clean up To reduce the image size, delete the
ToolsHadolint
Use Using
ToolsHadolint
**Pin versions in `apt-get install`.**
It's recommended to pin versions in `apt-get install` to ensure consistent builds.
```dockerfile
RUN apt-get update && apt-get install -y nodejs=12.22.12 npm=6.14.15 supervisor=4.2.2
```
<details>
<summary>Tools</summary>
<details>
<summary>Hadolint</summary><blockquote>
[warning] 5-5: Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`
(DL3008)
---
[info] 5-5: Delete the apt-get lists after installing something
(DL3009)
---
[info] 5-5: Avoid additional packages by specifying `--no-install-recommends`
(DL3015)
</blockquote></details>
</details>
<!-- This is an auto-generated comment by CodeRabbit -->
---
**Clean up `apt-get` lists after installation.**
To reduce the image size, delete the `apt-get` lists after installing packages.
```dockerfile
RUN apt-get update && apt-get install -y --no-install-recommends nodejs npm supervisor && \
rm -rf /var/lib/apt/lists/*
```
<details>
<summary>Tools</summary>
<details>
<summary>Hadolint</summary><blockquote>
[warning] 5-5: Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`
(DL3008)
---
[info] 5-5: Delete the apt-get lists after installing something
(DL3009)
---
[info] 5-5: Avoid additional packages by specifying `--no-install-recommends`
(DL3015)
</blockquote></details>
</details>
<!-- This is an auto-generated comment by CodeRabbit -->
---
**Use `--no-install-recommends` to avoid unnecessary packages.**
Using `--no-install-recommends` can help avoid installing additional packages that are not needed.
```dockerfile
RUN apt-get update && apt-get install -y --no-install-recommends nodejs npm supervisor
```
<details>
<summary>Tools</summary>
<details>
<summary>Hadolint</summary><blockquote>
[warning] 5-5: Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`
(DL3008)
---
[info] 5-5: Delete the apt-get lists after installing something
(DL3009)
---
[info] 5-5: Avoid additional packages by specifying `--no-install-recommends`
(DL3015)
</blockquote></details>
</details>
<!-- This is an auto-generated comment by CodeRabbit -->
![]() Avoid using For security reasons, it's recommended to avoid running containers as the root user. Consider switching to a non-root user.
ToolsHadolint
**Avoid using `USER root` as the last instruction.**
For security reasons, it's recommended to avoid running containers as the root user. Consider switching to a non-root user.
```dockerfile
# Example: Create a non-root user and switch to it
RUN useradd -ms /bin/bash appuser
USER appuser
```
<details>
<summary>Tools</summary>
<details>
<summary>Hadolint</summary><blockquote>
[warning] 15-15: Last USER should not be root
(DL3002)
</blockquote></details>
</details>
<!-- This is an auto-generated comment by CodeRabbit -->
![]() Avoid using For security reasons, it's recommended to avoid running containers as the root user. Consider switching to a non-root user.
ToolsHadolint
**Avoid using `USER root` as the last instruction.**
For security reasons, it's recommended to avoid running containers as the root user. Consider switching to a non-root user.
```dockerfile
# Example: Create a non-root user and switch to it
RUN useradd -ms /bin/bash appuser
USER appuser
```
<details>
<summary>Tools</summary>
<details>
<summary>Hadolint</summary><blockquote>
[warning] 15-15: Last USER should not be root
(DL3002)
</blockquote></details>
</details>
<!-- This is an auto-generated comment by CodeRabbit -->
![]() Consolidate Consolidate the
ToolsHadolint
**Consolidate `RUN` instructions for efficiency.**
Consolidate the `RUN` instructions to reduce the number of layers in the Docker image.
```dockerfile
RUN chown -R 1000:1000 /srv/app /usr/local/cargo /.local/share/dioxus && \
mkdir -p /.local/share/dioxus
```
<details>
<summary>Tools</summary>
<details>
<summary>Hadolint</summary><blockquote>
[info] 15-15: Multiple consecutive `RUN` instructions. Consider consolidation.
(DL3059)
---
[info] 16-16: Multiple consecutive `RUN` instructions. Consider consolidation.
(DL3059)
---
[info] 17-17: Multiple consecutive `RUN` instructions. Consider consolidation.
(DL3059)
</blockquote></details>
</details>
<!-- This is an auto-generated comment by CodeRabbit -->
![]() Consolidate Consolidate the
ToolsHadolint
**Consolidate `RUN` instructions for efficiency.**
Consolidate the `RUN` instructions to reduce the number of layers in the Docker image.
```dockerfile
RUN chown -R 1000:1000 /srv/app /usr/local/cargo /.local/share/dioxus && \
mkdir -p /.local/share/dioxus
```
<details>
<summary>Tools</summary>
<details>
<summary>Hadolint</summary><blockquote>
[info] 15-15: Multiple consecutive `RUN` instructions. Consider consolidation.
(DL3059)
---
[info] 16-16: Multiple consecutive `RUN` instructions. Consider consolidation.
(DL3059)
---
[info] 17-17: Multiple consecutive `RUN` instructions. Consider consolidation.
(DL3059)
</blockquote></details>
</details>
<!-- This is an auto-generated comment by CodeRabbit -->
![]() Use JSON notation for CMD instruction. Using JSON notation for the CMD instruction ensures better handling of arguments and prevents issues related to shell interpretation.
Committable suggestion
ToolsHadolint
**Use JSON notation for CMD instruction.**
Using JSON notation for the CMD instruction ensures better handling of arguments and prevents issues related to shell interpretation.
```diff
- CMD sh docker/dev/app/entrypoint.sh
+ CMD ["sh", "docker/dev/app/entrypoint.sh"]
```
<!-- suggestion_start -->
<details>
<summary>Committable suggestion</summary>
> :bangbang: **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
`````suggestion
CMD ["sh", "docker/dev/app/entrypoint.sh"]
`````
</details>
<!-- suggestion_end -->
<details>
<summary>Tools</summary>
<details>
<summary>Hadolint</summary><blockquote>
[warning] 23-23: Use arguments JSON notation for CMD and ENTRYPOINT arguments
(DL3025)
</blockquote></details>
</details>
<!-- This is an auto-generated comment by CodeRabbit -->
![]() Use JSON notation for CMD instruction. Using JSON notation for the CMD instruction ensures better handling of arguments and prevents issues related to shell interpretation.
Committable suggestion
ToolsHadolint
**Use JSON notation for CMD instruction.**
Using JSON notation for the CMD instruction ensures better handling of arguments and prevents issues related to shell interpretation.
```diff
- CMD sh docker/dev/app/entrypoint.sh
+ CMD ["sh", "docker/dev/app/entrypoint.sh"]
```
<!-- suggestion_start -->
<details>
<summary>Committable suggestion</summary>
> :bangbang: **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
`````suggestion
CMD ["sh", "docker/dev/app/entrypoint.sh"]
`````
</details>
<!-- suggestion_end -->
<details>
<summary>Tools</summary>
<details>
<summary>Hadolint</summary><blockquote>
[warning] 23-23: Use arguments JSON notation for CMD and ENTRYPOINT arguments
(DL3025)
</blockquote></details>
</details>
<!-- This is an auto-generated comment by CodeRabbit -->
|
3
docker/dev/app/entrypoint.sh
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
diesel migration run
|
||||||
|
|
||||||
|
supervisord -c /etc/supervisor/conf.d/supervisord.conf
|
Fix spacing inside brackets.
There are too many spaces inside the brackets in lines 18, 19, 23, and 24. This can be corrected for better readability and to adhere to YAML style guidelines.
Also applies to: 19-19, 23-23, 24-24
Tools
yamllint
This is how RustRover formats by default and Super-linter is okay with it.
@matous-volf, understood. If RustRover and Super-linter are configured to accept this formatting, it's perfectly fine to keep it as is. Thanks for clarifying!