Skip to content

Instantly share code, notes, and snippets.

@Resonious
Last active January 14, 2020 04:30
Show Gist options
  • Save Resonious/95b3cc7b971f30210ebf8c420f63315c to your computer and use it in GitHub Desktop.
Save Resonious/95b3cc7b971f30210ebf8c420f63315c to your computer and use it in GitHub Desktop.
Debian-based Dockerfile.kaiser for hats
FROM ruby:2.6.5
ENV _GIT_REVISION='development (kaiser)'
ARG UID=1000
# Setup 'app' user
RUN mkdir -p /app && \
useradd -U -u $UID --home-dir /app app && \
echo 'gem: --no-rdoc --no-ri' > ~/.gemrc
# Install system packages
RUN apt-get update && apt-get install -y curl git build-essential
# Install NPM
RUN wget https://nodejs.org/dist/v10.16.3/node-v10.16.3-linux-x64.tar.xz && \
tar -xf node-v10.16.3-linux-x64.tar.xz && \
cp -r node-v10.16.3-linux-x64/bin/* /usr/bin/ && \
cp -r node-v10.16.3-linux-x64/lib/* /usr/lib/ && \
cp -r node-v10.16.3-linux-x64/share/* /usr/share/
# Install yarn
RUN npm install -g yarn
RUN cd /app && ls
WORKDIR /app
ENV CONTAINER=true
ADD yarn.lock package.json /app/
RUN chown -R app /app && chgrp -R app /app
USER app
RUN yarn
EXPOSE 9000
CMD ["sh", "-c", "bin/webpack && rails s -p 9000 -b 0.0.0.0"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment