Clean up Dockerfile & File Structure

This commit is contained in:
pipeCh 2017-12-21 20:12:14 +07:00
parent be49c2bc46
commit 0c3cc85b54
8 changed files with 20 additions and 21 deletions

View file

@ -1,31 +1,37 @@
#bench Dockerfile
FROM ubuntu:16.04 FROM ubuntu:16.04
MAINTAINER frappé MAINTAINER frappé
#install pre-requisites #install pre-requisites
USER root USER root
RUN apt-get update RUN apt-get update
RUN apt-get install -y sudo
RUN apt-get install -y iputils-ping RUN apt-get install -y iputils-ping
RUN apt-get install -y git build-essential python-setuptools python-dev libffi-dev libssl-dev RUN apt-get install -y git build-essential python-setuptools python-dev libffi-dev libssl-dev
RUN apt-get install -y redis-tools software-properties-common libxrender1 libxext6 xfonts-75dpi xfonts-base RUN apt-get install -y redis-tools software-properties-common libxrender1 libxext6 xfonts-75dpi xfonts-base
RUN apt-get install -y libjpeg8-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev python-tk apt-transport-https libsasl2-dev libldap2-dev libtiff5-dev tcl8.6-dev tk8.6-dev RUN apt-get install -y libjpeg8-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev python-tk apt-transport-https libsasl2-dev libldap2-dev libtiff5-dev tcl8.6-dev tk8.6-dev
RUN apt-get install -y libmysqlclient-dev mariadb-client mariadb-common
RUN apt-get install -y wget RUN apt-get install -y wget
RUN wget https://bootstrap.pypa.io/get-pip.py && python get-pip.py
RUN pip install --upgrade setuptools pip
RUN useradd -ms /bin/bash frappe
RUN apt-get install -y curl RUN apt-get install -y curl
RUN apt-get install -y rlwrap RUN apt-get install -y rlwrap
RUN apt-get install redis-tools RUN apt-get install -y redis-tools
RUN apt-get install -y nano RUN apt-get install -y nano
RUN apt-get install -y curl
RUN apt-get install -y wkhtmltopdf
RUN wget https://bootstrap.pypa.io/get-pip.py && python get-pip.py
RUN pip install --upgrade setuptools pip
RUN apt-get upgrade
#add users & sudoers
USER root
RUN useradd -ms /bin/bash frappe
RUN usermod -aG sudo frappe
RUN printf '# User rules for frappe\nfrappe ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers.d/frappe
#install nodejs #install nodejs
USER root USER root
RUN apt-get install curl
RUN curl https://deb.nodesource.com/node_6.x/pool/main/n/nodejs/nodejs_6.7.0-1nodesource1~xenial1_amd64.deb > node.deb \ RUN curl https://deb.nodesource.com/node_6.x/pool/main/n/nodejs/nodejs_6.7.0-1nodesource1~xenial1_amd64.deb > node.deb \
&& dpkg -i node.deb \ && dpkg -i node.deb \
&& rm node.deb && rm node.deb
RUN apt-get install -y wkhtmltopdf
#clone bench repo #clone bench repo
USER frappe USER frappe
@ -35,16 +41,9 @@ RUN git clone -b develop https://github.com/frappe/bench.git bench-repo
#install bench #install bench
USER root USER root
RUN pip install -e bench-repo RUN pip install -e bench-repo
RUN apt-get install -y libmysqlclient-dev mariadb-client mariadb-common
RUN mkdir /home/frappe/frappe-bench RUN mkdir /home/frappe/frappe-bench
RUN chown -R frappe:frappe /home/frappe/* RUN chown -R frappe:frappe /home/frappe/*
#install sudo and add sudoers
USER root
RUN apt-get install sudo \
&& usermod -aG sudo frappe \
&& printf '# User rules for frappe\nfrappe ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers.d/frappe
COPY ./conf/frappe/* /home/frappe/ COPY ./conf/frappe/* /home/frappe/
USER frappe USER frappe

View file

@ -15,7 +15,7 @@ services:
image: redis:alpine image: redis:alpine
volumes: volumes:
- ./redis-conf/redis_cache.conf:/etc/conf.d/redis.conf - ./conf/redis-conf/redis_cache.conf:/etc/conf.d/redis.conf
command: ["redis-server","/etc/conf.d/redis.conf"] command: ["redis-server","/etc/conf.d/redis.conf"]
@ -25,7 +25,7 @@ services:
image: redis:alpine image: redis:alpine
volumes: volumes:
- ./redis-conf/redis_queue.conf:/etc/conf.d/redis.conf - ./conf/redis-conf/redis_queue.conf:/etc/conf.d/redis.conf
command: ["redis-server","/etc/conf.d/redis.conf"] command: ["redis-server","/etc/conf.d/redis.conf"]
@ -35,7 +35,7 @@ services:
image: redis:alpine image: redis:alpine
volumes: volumes:
- ./redis-conf/redis_socketio.conf:/etc/conf.d/redis.conf - ./conf/redis-conf/redis_socketio.conf:/etc/conf.d/redis.conf
command: ["redis-server","/etc/conf.d/redis.conf"] command: ["redis-server","/etc/conf.d/redis.conf"]