Skip to content

Commit

Permalink
Run as a user in the dev docker container
Browse files Browse the repository at this point in the history
  • Loading branch information
johnf committed Oct 28, 2023
1 parent ca15496 commit fb8758a
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,7 @@ RUN npm install --global yarn
RUN wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
RUN apt-get -y install ./google-chrome-stable_current_amd64.deb

VOLUME /app
WORKDIR /app

RUN mkdir -p /home/johnf/work/nabu; ln -s /app /home/johnf/work/nabu/nabu

# AWS tools
RUN cd /tmp \
&& curl -s "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" \
&& unzip -q awscliv2.zip \
Expand All @@ -59,4 +55,14 @@ RUN cd /tmp \
&& curl "https://s3.amazonaws.com/session-manager-downloads/plugin/latest/ubuntu_64bit/session-manager-plugin.deb" -o "session-manager-plugin.deb" \
&& dpkg -i session-manager-plugin.deb


VOLUME /app
WORKDIR /app

RUN mkdir -p /home/johnf/work/nabu; ln -s /app /home/johnf/work/nabu/nabu

RUN useradd -ms /bin/bash deploy

USER deploy

CMD ["bin/rails", "server", "-b", "0.0.0.0"]

0 comments on commit fb8758a

Please sign in to comment.