forked from ComPlat/chemotion_ELN
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
40 lines (33 loc) · 1.26 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
FROM ruby:2.3.1
# prepare
RUN apt-get -y update --fix-missing
RUN apt-get -y install apt-utils
RUN apt-get -y install build-essential wget git cmake nodejs sudo postgresql-client --fix-missing
# install curl
RUN apt-get -y install curl
RUN curl -sL https://deb.nodesource.com/setup_4.x | bash
# install rmagick
RUN apt-get -y install libmagickcore-dev libmagickwand-dev
# create docker user
RUN useradd -ms /bin/bash docker
RUN echo 'docker ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
# disable ssh strict host key checking; should not be disabled in production
RUN sed -i '/StrictHostKeyChecking/c\StrictHostKeyChecking no' /etc/ssh/ssh_config
# node + npm via nvm; install npm packages
WORKDIR /tmp
RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.3/install.sh | NVM_DIR=/usr/local/nvm bash
COPY package.json /tmp/
COPY .nvmrc /tmp/
RUN /bin/bash -c 'source /usr/local/nvm/nvm.sh;\
nvm install;\
nvm use;\
npm install'
RUN echo '[ -s /usr/local/nvm/nvm.sh ] && . /usr/local/nvm/nvm.sh' >> /home/docker/.bashrc
# configure app
ENV BUNDLE_PATH /box
WORKDIR /usr/src/app
COPY . /usr/src/app/
RUN cp -a /tmp/node_modules /usr/src/app/
RUN sudo chown -R docker:nogroup /usr/src/app
RUN cp -a config/database.yml.example config/database.yml
RUN chmod +x run.sh