Skip to content

Commit

Permalink
user and group defined in alias and change permits for bundle (#15)
Browse files Browse the repository at this point in the history
* user and group defined in alias and change permits for bundle

* configuring it as ENV it's not user specific
  • Loading branch information
oniram88 authored Mar 12, 2024
1 parent 54b9602 commit ca027c2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ RUN apt-get update -qq && apt-get install -y nodejs && npm install -g yarn
WORKDIR /rails

# Ensure gems are installed on a persistent volume and available as bins
# Make the folder world writable to let the default user install the gems
RUN mkdir /bundle && chmod -R ugo+rwt /bundle
VOLUME /bundle
RUN bundle config set --global path '/bundle'
ENV BUNDLE_PATH='/bundle'
ENV PATH="/bundle/ruby/$RUBY_VERSION/bin:${PATH}"

# Install Rails
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Install [Docker](https://www.docker.com/products/docker-desktop/) (and [WSL](htt

```bash
docker volume create ruby-bundle-cache
alias docked='docker run --rm -it -v ${PWD}:/rails -v ruby-bundle-cache:/bundle -p 3000:3000 ghcr.io/rails/cli'
alias docked='docker run --rm -it -v ${PWD}:/rails -u $(id -u):$(id -g) -v ruby-bundle-cache:/bundle -p 3000:3000 ghcr.io/rails/cli'
```

Then create your Rails app:
Expand Down

0 comments on commit ca027c2

Please sign in to comment.