-
Notifications
You must be signed in to change notification settings - Fork 4
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
chore: fe deployment #85
Conversation
WalkthroughThe changes primarily focus on Docker and Nix configurations for a web application. They include modifications to environment variables, Dockerfile commands, and scripts for running Docker images. The updates also introduce new Nix expressions for building, running, and pushing Docker images. Changes
|
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.
Files selected for processing (7)
- Dockerfile.web (1 hunks)
- docker-files/run-server.sh (1 hunks)
- docker-files/run-web.sh (1 hunks)
- docker-files/start_web.sh (1 hunks)
- flake.nix (1 hunks)
- react-web/.env.production (1 hunks)
- web.nix (1 hunks)
Files skipped from review due to trivial changes (5)
- docker-files/run-server.sh
- docker-files/run-web.sh
- docker-files/start_web.sh
- react-web/.env.production
- web.nix
Review comments generated (3)
- Actionable : 3
- LGTM (Skipped): 0
- Noise Suppression (Skipped): 4
Tips
Chat with CodeRabbit Bot (@coderabbitai
)
- Tag the bot with
@coderabbitai
in any review comment to ask it questions. The bot will not respond unless explicitly tagged. - A review comment is a comment on a diff or a file and not a comment on the PR itself.
- You can use the mouse to select multiple lines of code to provide exact context to the bot.
Code suggestions
- The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
- You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.
Pausing incremental reviews
- Add
@coderabbitai: ignore
anywhere in the PR description to pause further reviews from the bot.
COPY ./docker-files/.env.local . | ||
RUN npm install | ||
#COPY ./docker-files/.env.local . | ||
RUN npm install --global serve |
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 serve
package is being installed globally. This package is typically used to serve static files. If the application relies on other packages that were previously installed with npm install
, those packages may not be available anymore. Please ensure that all necessary dependencies are still being installed.
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.
not bad 😄
RUN rm ./.env | ||
#RUN rm ./.env.production | ||
|
||
RUN npm run build |
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 npm run build
command is being executed. This command typically creates a production-ready version of the application. If there are any build scripts that need to be run before this command, they may not be executed anymore. Please ensure that all necessary build steps are still being performed.
|
||
COPY ./docker-files/start_web.sh . | ||
RUN chmod +x ./start_web.sh | ||
|
||
ENTRYPOINT [ "./start_web.sh" ] | ||
#ENTRYPOINT [ "/bin/sh","-c","./start_web.sh"] | ||
CMD [ "npm","start" ] | ||
#CMD [ "npm","start" ] |
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 CMD
command has been commented out. This command specifies the default command that should be run when the container starts. If the ENTRYPOINT
command does not start the application, it may not run when the container starts. Please ensure that the application is started correctly when the container runs.
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.
@RSoulatIOHK Sure, I'd be happy to explain further.
In a Dockerfile, the CMD
instruction provides defaults for an executing container. These can include an executable, or they can omit the executable, in which case you must specify an ENTRYPOINT
instruction. The CMD
values can be overridden when starting a container.
The ENTRYPOINT
instruction allows you to configure a container that will run as an executable. It has two forms:
- The exec form, which is the preferred form:
ENTRYPOINT ["executable", "param1", "param2"]
- The shell form,
ENTRYPOINT command param1 param2
In your Dockerfile, you have commented out the CMD
instruction and are using the ENTRYPOINT
instruction to start the application. This means that when the Docker container starts, it will execute the start_web.sh
script.
However, if the start_web.sh
script does not start the application (for example, if it only prepares the environment), then the application will not run when the Docker container starts. This is because there is no CMD
instruction to start the application.
To ensure that your application runs when the Docker container starts, you should either:
- Make sure that the
start_web.sh
script starts the application. - Uncomment the
CMD
instruction so that it starts the application after theENTRYPOINT
instruction has completed.
I hope this clarifies things. Let me know if you have any other questions!
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.
@CodeRabbit server build
command from the last line of the entrypoint
file starts the application from the build
folder
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.
Files selected for processing (2)
- docker-files/start_web.sh (1 hunks)
- web.nix (1 hunks)
Files skipped from review due to trivial changes (1)
- docker-files/start_web.sh
Review comments generated (1)
- Actionable : 1
- LGTM (Skipped): 0
- Noise Suppression (Skipped): 3
Tips
Chat with CodeRabbit Bot (@coderabbitai
)
- Tag the bot with
@coderabbitai
in any review comment to ask it questions. The bot will not respond unless explicitly tagged. - A review comment is a comment on a diff or a file and not a comment on the PR itself.
- You can use the mouse to select multiple lines of code to provide exact context to the bot.
Code suggestions
- The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
- You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.
Pausing incremental reviews
- Add
@coderabbitai: ignore
anywhere in the PR description to pause further reviews from the bot.
${pkgs.docker}/bin/docker build -t ${imgAttributes.name}:${imgAttributes.tag} -f ./Dockerfile.web . | ||
#${pkgs.docker}/bin/docker save ${imgAttributes.name}:${imgAttributes.tag} | ${pkgs.docker}/bin/docker load | ||
#and now load the image into docker | ||
#${pkgs.docker}/bin/docker image ls | ||
'').outPath; |
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 command to save and load the Docker image is commented out. If this is intentional, consider removing these lines to avoid confusion.
- #${pkgs.docker}/bin/docker save ${imgAttributes.name}:${imgAttributes.tag} | ${pkgs.docker}/bin/docker load
- #and now load the image into docker
- #${pkgs.docker}/bin/docker image ls
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.
Files selected for processing (2)
- Dockerfile.web (1 hunks)
- web.nix (1 hunks)
Files skipped from review due to trivial changes (2)
- Dockerfile.web
- web.nix
Review comments generated (0)
- Actionable : 0
- LGTM (Skipped): 0
- Noise Suppression (Skipped): 0
Tips
Chat with CodeRabbit Bot (@coderabbitai
)
- Tag the bot with
@coderabbitai
in any review comment to ask it questions. The bot will not respond unless explicitly tagged. - A review comment is a comment on a diff or a file and not a comment on the PR itself.
- You can use the mouse to select multiple lines of code to provide exact context to the bot.
Code suggestions
- The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
- You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.
Pausing incremental reviews
- Add
@coderabbitai: ignore
anywhere in the PR description to pause further reviews from the bot.
the fe was detached from this repo |
Summary by CodeRabbit
Release Notes
Refactor:
New Feature:
These changes aim to streamline the Docker image creation and deployment process, enhancing the overall performance and maintainability of the application.