2
0
mirror of https://github.com/frappe/frappe_docker.git synced 2024-12-23 10:38:58 +00:00

Merge pull request #90 from Thunderbottom/remove-deprecated

chore: cleanup redundant files
This commit is contained in:
Revant Nandgaonkar 2020-03-02 23:12:20 +05:30 committed by GitHub
commit 97ec097870
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 1 additions and 231 deletions

View File

@ -1,10 +1,7 @@
# frappe_docker .dockerignore file
conf/*
.travis.yml
test.sh
README.md
LICENSE.md
.gitignore
dbench
docker-*.yml
docker-*.yml

View File

@ -14,26 +14,11 @@ before_install:
sudo apt-get update && sudo apt-get -y install docker-compose;
fi
install:
- if [[ $BUILD == "development" ]];then
chmod ugo+x ./dbench;
chmod ugo+x ./test.sh;
./dbench setup docker;
./dbench init frappe-bench;
./dbench new-site site1.local;
./dbench setup hosts;
fi
after_success:
- docker --version
matrix:
include:
- name: "Test Frappe / ERPNext development"
env: BUILD=development
script:
- ./test.sh
- ./dbench setup docker stop
- name: "Build Frappe python environment (edge)"
if: branch = develop AND type != pull_request
script:

View File

@ -1,50 +0,0 @@
# Frappe Bench Dockerfile
FROM debian:9.6-slim
LABEL author=frappé
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends locales \
&& sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen \
&& dpkg-reconfigure --frontend=noninteractive locales \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# Set locale en_us.UTF-8 for mariadb and general locale data
ENV PYTHONIOENCODING=utf-8
ENV LANGUAGE=en_US.UTF-8
ENV LANG=en_US.UTF-8
ENV LC_ALL=en_US.UTF-8
# Install all neccesary packages
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-suggests --no-install-recommends \
build-essential cron curl git libffi-dev liblcms2-dev libldap2-dev libmariadbclient-dev libsasl2-dev libssl1.0-dev libtiff5-dev \
libwebp-dev mariadb-client iputils-ping python-dev python-pip python-setuptools python-tk redis-tools rlwrap \
software-properties-common sudo tk8.6-dev vim xfonts-75dpi xfonts-base wget wkhtmltopdf fonts-cantarell \
&& apt-get clean && rm -rf /var/lib/apt/lists/* \
&& curl https://deb.nodesource.com/node_10.x/pool/main/n/nodejs/nodejs_10.10.0-1nodesource1_amd64.deb > node.deb \
&& dpkg -i node.deb \
&& rm node.deb \
&& npm install -g yarn
# Install wkhtmltox correctly
RUN wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.stretch_amd64.deb
RUN dpkg -i wkhtmltox_0.12.5-1.stretch_amd64.deb && rm wkhtmltox_0.12.5-1.stretch_amd64.deb
# Add frappe user and setup sudo
RUN groupadd -g 500 frappe \
&& useradd -ms /bin/bash -u 500 -g 500 -G sudo frappe \
&& printf '# Sudo rules for frappe\nfrappe ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/frappe \
&& chown -R 500:500 /home/frappe
# Install bench
RUN pip install -e git+https://github.com/frappe/bench.git#egg=bench --no-cache
USER frappe
# Add some bench files
COPY --chown=frappe:frappe ./frappe-bench /home/frappe/frappe-bench
WORKDIR /home/frappe/frappe-bench
EXPOSE 8000 9000 6787
VOLUME [ "/home/frappe/frappe-bench" ]

View File

@ -1,38 +0,0 @@
# MariaDB-specific config file.
# Read by /etc/mysql/my.cnf
[client]
# Default is Latin1, if you need UTF-8 set this (also in server section)
#default-character-set = utf8
[mysqld]
#
# * Character sets
#
# Default is Latin1, if you need UTF-8 set all this (also in client section)
#
#character-set-server = utf8
#collation-server = utf8_general_ci
#character_set_server = utf8
#collation_server = utf8_general_ci
bind-address = 0.0.0.0
# Import all .cnf files from configuration directory
!includedir /etc/mysql/mariadb.conf.d/
[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
[mysql]
default-character-set = utf8mb4
[mysqld_safe]
skip_log_error
syslog
[mysqldump]
quick
quote-names
max_allowed_packet = 16M

View File

@ -1,8 +0,0 @@
dbfilename redis_cache.rdb
bind 0.0.0.0
port 13000
maxmemory 292mb
maxmemory-policy allkeys-lru
appendonly no
save ""

View File

@ -1,3 +0,0 @@
dbfilename redis_queue.rdb
bind 0.0.0.0
port 11000

View File

@ -1,3 +0,0 @@
dbfilename redis_socketio.rdb
bind 0.0.0.0
port 12000

61
dbench
View File

@ -1,61 +0,0 @@
#!/bin/bash
function run () {
user=$1
shift
docker exec -itu "${user}" frappe bash -c "$@"
}
if [[ $# -eq 0 ]]; then
docker exec -it frappe bash
elif [[ "$1" == 'init' ]]; then
run root "chown -R frappe:frappe /home/frappe"
run frappe "cd .. && bench init frappe-bench --ignore-exist --skip-redis-config-generation && cd frappe-bench"
run frappe "mv Procfile_docker Procfile && mv sites/common_site_config_docker.json sites/common_site_config.json && bench set-mariadb-host mariadb"
elif [[ "$1" == 'setup' ]]; then
if [[ "$2" == 'docker' ]]; then
if [[ "$3" == '--swarm-mode' ]]; then
echo "Docker swarm mode is not currently supported"
elif [[ "$3" == 'down' ]]; then
docker-compose down
elif [[ "$3" == 'stop' ]]; then
docker-compose stop
else
docker-compose up -d
fi
elif [[ "$2" == 'hosts' ]]; then
a=$(run frappe "ls sites/*/site_config.json | grep -o '/.\+/'")
a="${a//$'\n'/ }"
a=$(echo "$a" | tr -d / )
result="127.0.0.1 ${a}"
run root "echo ${result} | tee -a /etc/hosts"
else
IFS=" "
run frappe "bench $*"
fi
elif [[ "$1" == '-c' ]]; then
shift
user=$1
shift
run "$user" "$@"
elif [[ "$1" == '-h' ]]; then
echo "$0 [-h] | [-c frappe|root command] | [setup hosts|docker [stop|down]] | [bench_command]"
echo ""
echo "$0 is a wrapper for the Frappe Bench tool, and is used like it. However, it extends the tool in a few places."
echo "Usage:"
echo " $0 -h"
echo " Shows this help message"
echo " $0"
echo " Launches you into an interactive shell in the container as user frappe"
echo " $0 <command to send to bench>"
echo " Runs the bench command <command>, i.e. $0 new-site \"site1.local\" = bench new-site \"site1.local\""
echo " $0 setup docker [ stop | down ]"
echo " Builds and starts the docker containers using \"docker-compose up -d\""
echo " $0 setup hosts"
echo " Adds all site names to the containers hosts file"
echo " $0 -c frappe | root <command to run>"
echo " Runs a command in the container, as the selected user"
else
IFS=" "
run frappe "bench $*"
fi

View File

@ -1,8 +0,0 @@
web: bench serve --port 8000
socketio: /usr/bin/node apps/frappe/socketio.js
watch: bench watch
schedule: bench schedule
worker_short: bench worker --queue short
worker_long: bench worker --queue long
worker_default: bench worker --queue default

View File

@ -1,20 +0,0 @@
{
"auto_update": false,
"background_workers": 1,
"db_host": "mariadb",
"file_watcher_port": 6787,
"frappe_user": "frappe",
"gunicorn_workers": 4,
"rebase_on_pull": false,
"redis_cache": "redis://redis-cache:13000",
"redis_queue": "redis://redis-queue:11000",
"redis_socketio": "redis://redis-socketio:12000",
"restart_supervisor_on_update": false,
"root_password": "123",
"serve_default_site": true,
"shallow_clone": true,
"socketio_port": 9000,
"update_bench_on_update": true,
"webserver_port": 8000,
"admin_password": "admin"
}

21
test.sh
View File

@ -1,21 +0,0 @@
#!/bin/bash
docker container ls | grep frappe
docker container ls | grep mariadb
docker container ls | grep redis-cache
docker container ls | grep redis-queue
docker container ls | grep redis-socketio
cat <(./dbench start) &
while ! [[ $i == 20 ]]
do
output=$( curl "http://localhost:8000" )
{ echo "Exit status of curl: $?"
} 1>&2
sleep 2
i=$((i + 1))
echo "${output}" | grep '<title> Login </title>' && exit
done
if ! [[ "$?" == 0 ]]; then exit 1; fi