As I was following the following Auth0 tutorial to bootstrap a quick rails project, I decided to avoid configuring a droplet by using the managed offer called "apps".
After setting up the app and the required env vars, the build failed at the step where the docker file specifies to create a log folder for production logs, because of a permission error:
args: [-c mkdir log && touch log/production.log && mkdir -p tmp/pids]
[2022-02-03 17:38:38] INFO[0060] util.Lookup returned: &{Uid:1000 Gid:1000 Username:developer Name: HomeDir:/home/developer}
[2022-02-03 17:38:38] INFO[0060] performing slow lookup of group ids for developer
[2022-02-03 17:38:38] INFO[0060] Running: [/bin/sh -c mkdir log && touch log/production.log && mkdir -p tmp/pids]
[2022-02-03 17:38:38] mkdir: cannot create directory ‘log’: Permission denied
As per my understanding, it's not possible to log into the shell of managed apps I'm wondering how I can deal with this error as I don't understand how to give this user the permission to proceed, neither can think of any other solution.
For the record, here is the complete docker file:
FROM ruby:3.1.0@sha256:c980973bd1a1475349da614701cce0e19e6b0b93238a53ea9c07380e64c264c7 as build
RUN groupadd auth0 && useradd -m developer -g auth0
USER developer
RUN mkdir /home/developer/app
WORKDIR /home/developer/app
COPY Gemfile* ./
RUN bundle config set --local deployment 'true'
RUN bundle config set --local without 'development test'
RUN bundle install --retry 3
COPY app app
COPY config config
COPY config.ru Rakefile ./
FROM ruby:3.1.0-slim-buster@sha256:1a3487de40a5400638f9494d7f920b21e26cdec949ad7d1851a84bb93f95b93a
RUN groupadd auth0 && useradd -m developer -g auth0
USER developer
RUN mkdir /home/developer/app
WORKDIR /home/developer/app
COPY --from=build /home/developer/app /home/developer/app
RUN mkdir log \
&& touch log/production.log \
&& mkdir -p tmp/pids
RUN bundle config set --local deployment 'true'
RUN bundle config set --local without 'development test'
ENV RAILS_ENV=production
EXPOSE 6060
CMD ["bundle", "exec", "puma"]
Otherwise, how shall I handle logs with digital ocean managed apps?