Skip to content

Commit

Permalink
Adds Docker support for running linters workers
Browse files Browse the repository at this point in the history
  • Loading branch information
blackjid committed Mar 1, 2019
1 parent 2f745a7 commit 9a2f09f
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.git
.foreman
.bundle
db/*.sqlite3
log/*.log
tmp
.env.local
dump.rdb
node_modules
39 changes: 39 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
FROM ruby:2.4.1

RUN apt-get update && apt-get install -y apt-transport-https \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Add node source
RUN curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -
RUN echo 'deb https://deb.nodesource.com/node_8.x jessie main' > /etc/apt/sources.list.d/nodesource.list
RUN echo 'deb-src https://deb.nodesource.com/node_8.x jessie main' >> /etc/apt/sources.list.d/nodesource.list

# Add yarn source
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo 'deb https://dl.yarnpkg.com/debian/ stable main' > /etc/apt/sources.list.d/yarn.list

RUN apt-get update && apt-get install -y --no-install-recommends \
locales \
nodejs \
yarn \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

RUN localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8
ENV LC_ALL en_US.UTF-8

RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app

COPY Gemfile /usr/src/app/
COPY Gemfile.lock /usr/src/app/
RUN bundle install

COPY package.json /usr/src/app/
COPY yarn.lock /usr/src/app/
RUN yarn

COPY . /usr/src/app

CMD bundle exec rake jobs:work
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "1.0.0",
"description": "Use Node for JS based linters",
"engines": {
"node": "8.4.0"
"node": "^8.4.0"
},
"dependencies": {
"babel-eslint": "^8.0.1",
Expand Down

0 comments on commit 9a2f09f

Please sign in to comment.