Skip to content

Commit

Permalink
restore /dev/ for non-root users
Browse files Browse the repository at this point in the history
Fixes #48
  • Loading branch information
rubys committed Aug 1, 2023
1 parent 33d111e commit 8292135
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions lib/generators/templates/_nginx.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ RUN gem install foreman && \
<% unless run_as_root? -%>
sed -i 's|pid /run|pid /rails/tmp/pids|' /etc/nginx/nginx.conf && \
<% end -%>
sed -i 's/access_log\s.*;/access_log stdout;/' /etc/nginx/nginx.conf && \
sed -i 's/error_log\s.*;/error_log stderr info;/' /etc/nginx/nginx.conf
sed -i 's/access_log\s.*;/access_log <% unless run_as_root? %>\/dev\/<% end %>stdout;/' /etc/nginx/nginx.conf && \
sed -i 's/error_log\s.*;/error_log <% unless run_as_root? %>\/dev\/<% end %>stderr info;/' /etc/nginx/nginx.conf

COPY <<-"EOF" /etc/nginx/sites-available/default
server {
listen 3000 default_server;
listen [::]:3000 default_server;
access_log stdout;
access_log <% unless run_as_root? %>/dev/<% end %>stdout;

root /rails/public;

Expand Down
6 changes: 3 additions & 3 deletions test/results/nginx/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ RUN apt-get update -qq && \
# configure nginx
RUN gem install foreman && \
sed -i 's|pid /run|pid /rails/tmp/pids|' /etc/nginx/nginx.conf && \
sed -i 's/access_log\s.*;/access_log stdout;/' /etc/nginx/nginx.conf && \
sed -i 's/error_log\s.*;/error_log stderr info;/' /etc/nginx/nginx.conf
sed -i 's/access_log\s.*;/access_log \/dev\/stdout;/' /etc/nginx/nginx.conf && \
sed -i 's/error_log\s.*;/error_log \/dev\/stderr info;/' /etc/nginx/nginx.conf

COPY <<-"EOF" /etc/nginx/sites-available/default
server {
listen 3000 default_server;
listen [::]:3000 default_server;
access_log stdout;
access_log /dev/stdout;

root /rails/public;

Expand Down

0 comments on commit 8292135

Please sign in to comment.