Closed
Conversation
Avoid having to faff with local dependencies.
docker-compose build
docker-compose up
open http://0.0.0.0:4000
gbp
requested changes
Feb 10, 2025
| FROM ruby:3.2 | ||
|
|
||
| WORKDIR /app | ||
| COPY . . |
Member
There was a problem hiding this comment.
Think we need a .dockerignore file as when building the image the whole current directory is copied into the image, which in my case is gigabytes in size!
Something like:
.*
cache/
commonlib/
config/
coverage/
db/
files/
gems/
lib/
public/
storage/
tmp/
| WORKDIR /app | ||
| COPY . . | ||
|
|
||
| RUN gem install bundler jekyll |
Member
There was a problem hiding this comment.
No point in this as its already in the Gemfile.lock and could install a different versions than we're really using.
Suggested change
| RUN gem install bundler jekyll |
| @@ -0,0 +1,11 @@ | |||
| FROM ruby:3.2 | |||
Member
There was a problem hiding this comment.
Lets keep the image and small as possible
Suggested change
| FROM ruby:3.2 | |
| FROM ruby:3.2-slim | |
| RUN apt-get update -qq && \ | |
| apt-get install -y \ | |
| build-essential \ | |
| git \ | |
| && rm -rf /var/lib/apt/lists/* |
|
|
||
| EXPOSE 4000 | ||
|
|
||
| CMD ["bundle", "exec", "jekyll", "serve", "--host", "0.0.0.0"] |
Member
There was a problem hiding this comment.
This would be good, if it works?
Suggested change
| CMD ["bundle", "exec", "jekyll", "serve", "--host", "0.0.0.0"] | |
| CMD ["bundle", "exec", "jekyll", "serve", "--host", "0.0.0.0", "--livereload"] |
Comment on lines
+1
to
+2
| version: '3.8' | ||
|
|
Member
There was a problem hiding this comment.
Docker warns against including a version now. We should remove.
Suggested change
| version: '3.8' |
Member
Author
|
Closing for now; will reopen next time someone needs this |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add Dockerfile
Avoid having to faff with local dependencies.
[skip changelog]