Skip to content
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

fix local docker build and run #355

Merged
merged 1 commit into from
Jul 2, 2021
Merged

Conversation

jj-style
Copy link
Contributor

Fix #354 unable to build docker container.

Add gulp to normal node dependencies as currently not installed with npm install --production flag but is necessary to run with npm start in the container.
Add dockerignore file to ignore node_modules and other larger directories which slow down the docker build from COPY . /usr/src/app.
Bind on 0.0.0.0 so Raneto can be accessed from outside the container if the port is forwarded.

I have tested mounting a local content folder into the container at /usr/src/app/example/content and it works as expected.

@ryanlelek
Copy link
Owner

Thanks!
Yes, that will solve the issue for now.

This builds the assets with gulp in the Docker image.
In the future, we'll move to generating the assets outside Docker and copy them into the image.

A quick note:
The reason for the && is to perform 2 commands with one RUN Dockerfile statement.
Every RUN statement creates a new Docker image "layer" so 2 RUNs gives 2 layers.

@ryanlelek ryanlelek merged commit 823df9c into ryanlelek:master Jul 2, 2021
@jj-style
Copy link
Contributor Author

jj-style commented Jul 2, 2021

Thanks for the feedback!
Yeah I thought it made sense for Docker to handle pulling and building all dependencies inside the container.

Good point on the two commands in one, happy to combine that back to one.

We can also get clever with Docker and copy the package.json and do npm install and the gulp stuff before copying the source code to make use of Docker caching the image layers to make the builds faster!

AnkushLambdatest pushed a commit to AnkushLambdatest/Raneto that referenced this pull request Jun 29, 2022
@ryanlelek ryanlelek mentioned this pull request Aug 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to build Docker container
2 participants