mirror of
https://github.com/frappe/frappe_docker.git
synced 2026-06-26 00:55:10 +00:00
add init file to Docker Images
This commit is contained in:
parent
c2e45caba3
commit
af7915b4b8
6 changed files with 85 additions and 32 deletions
17
Dockerfile
17
Dockerfile
|
|
@ -1,9 +1,9 @@
|
||||||
|
|
||||||
#bench Dockerfile
|
#bench Dockerfile
|
||||||
|
|
||||||
FROM ubuntu:16.04
|
FROM ubuntu:16.04
|
||||||
MAINTAINER frappé
|
MAINTAINER frappé
|
||||||
|
|
||||||
|
#install pre-requisites
|
||||||
USER root
|
USER root
|
||||||
RUN apt-get update
|
RUN apt-get update
|
||||||
RUN apt-get install -y iputils-ping
|
RUN apt-get install -y iputils-ping
|
||||||
|
|
@ -19,22 +19,33 @@ RUN apt-get install -y rlwrap
|
||||||
RUN apt-get install redis-tools
|
RUN apt-get install redis-tools
|
||||||
RUN apt-get install -y nano
|
RUN apt-get install -y nano
|
||||||
|
|
||||||
|
#install nodejs
|
||||||
#nodejs
|
USER root
|
||||||
RUN apt-get install curl
|
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
|
RUN apt-get install -y wkhtmltopdf
|
||||||
|
|
||||||
|
#clone bench repo
|
||||||
USER frappe
|
USER frappe
|
||||||
WORKDIR /home/frappe
|
WORKDIR /home/frappe
|
||||||
RUN git clone -b develop https://github.com/frappe/bench.git bench-repo
|
RUN git clone -b develop https://github.com/frappe/bench.git bench-repo
|
||||||
|
|
||||||
|
#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 apt-get install -y libmysqlclient-dev mariadb-client mariadb-common
|
||||||
|
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/
|
||||||
|
|
||||||
USER frappe
|
USER frappe
|
||||||
WORKDIR /home/frappe/frappe-bench
|
WORKDIR /home/frappe/frappe-bench
|
||||||
|
|
|
||||||
27
README.md
27
README.md
|
|
@ -98,9 +98,34 @@ Express dependency between services, which has two effects:
|
||||||
|
|
||||||
Note: Please do not remove the bench-repo directory the above commands will create
|
Note: Please do not remove the bench-repo directory the above commands will create
|
||||||
|
|
||||||
|
#### Basic Usage from Windows Hosr
|
||||||
|
1. Command to start all the containers
|
||||||
|
|
||||||
|
docker-compose start
|
||||||
|
|
||||||
|
2. Command to enter your container
|
||||||
|
|
||||||
#### Basic Usage
|
docker exec -it frappe bash
|
||||||
|
|
||||||
|
3. First time setup
|
||||||
|
|
||||||
|
cd .. & . init.sh
|
||||||
|
|
||||||
|
|
||||||
|
##### Password
|
||||||
|
- MariaDB
|
||||||
|
|
||||||
|
User : root
|
||||||
|
|
||||||
|
Pass : 123
|
||||||
|
|
||||||
|
- Sites
|
||||||
|
|
||||||
|
User : Administrator
|
||||||
|
|
||||||
|
Pass : admin
|
||||||
|
|
||||||
|
#### Basic Usage from Linux Host
|
||||||
##### Make sure your current directory is frappe_docker
|
##### Make sure your current directory is frappe_docker
|
||||||
1. First time setup
|
1. First time setup
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
web: bench serve --port 8000
|
web: bench serve --port 8000
|
||||||
|
|
||||||
socketio: /usr/bin/node apps/frappe/socketio.js
|
socketio: /usr/bin/node apps/frappe/socketio.js
|
||||||
watch: bench watch
|
watch: bench watch
|
||||||
schedule: bench schedule
|
schedule: bench schedule
|
||||||
worker_short: bench worker --queue short
|
worker_short: bench worker --queue short
|
||||||
worker_long: bench worker --queue long
|
worker_long: bench worker --queue long
|
||||||
worker_default: bench worker --queue default
|
worker_default: bench worker --queue default
|
||||||
|
|
@ -1,20 +1,20 @@
|
||||||
{
|
{
|
||||||
"auto_update": false,
|
"auto_update": false,
|
||||||
"background_workers": 1,
|
"background_workers": 1,
|
||||||
"db_host": "mariadb",
|
"db_host": "mariadb",
|
||||||
"file_watcher_port": 6787,
|
"file_watcher_port": 6787,
|
||||||
"frappe_user": "frappe",
|
"frappe_user": "frappe",
|
||||||
"gunicorn_workers": 4,
|
"gunicorn_workers": 4,
|
||||||
"rebase_on_pull": false,
|
"rebase_on_pull": false,
|
||||||
"redis_cache": "redis://redis-cache:13000",
|
"redis_cache": "redis://redis-cache:13000",
|
||||||
"redis_queue": "redis://redis-queue:11000",
|
"redis_queue": "redis://redis-queue:11000",
|
||||||
"redis_socketio": "redis://redis-socketio:12000",
|
"redis_socketio": "redis://redis-socketio:12000",
|
||||||
"restart_supervisor_on_update": false,
|
"restart_supervisor_on_update": false,
|
||||||
"root_password": "123",
|
"root_password": "123",
|
||||||
"serve_default_site": true,
|
"serve_default_site": true,
|
||||||
"shallow_clone": true,
|
"shallow_clone": true,
|
||||||
"socketio_port": 9000,
|
"socketio_port": 9000,
|
||||||
"update_bench_on_update": true,
|
"update_bench_on_update": true,
|
||||||
"webserver_port": 8000,
|
"webserver_port": 8000,
|
||||||
"admin_password": "admin"
|
"admin_password": "admin"
|
||||||
}
|
}
|
||||||
16
conf/frappe/init.sh
Normal file
16
conf/frappe/init.sh
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
echo "----------------------- [ init bench ] ---------------------------------"
|
||||||
|
bench init frappe-bench --skip-bench-mkdir --skip-redis-config-generation
|
||||||
|
echo "----------------------- [ config bench ] ---------------------------------"
|
||||||
|
cd frappe-bench
|
||||||
|
mv /home/frappe/Procfile_docker /home/frappe/frappe-bench/Procfile
|
||||||
|
mv /home/frappe/common_site_config_docker.json /home/frappe/frappe-bench/sites/common_site_config.json
|
||||||
|
bench set-mariadb-host mariadb
|
||||||
|
echo "----------------------- [ new site ] ---------------------------------"
|
||||||
|
bench new-site site1.local --mariadb-root-password 123 --admin-password frappe
|
||||||
|
echo "----------------------- [ install erpnext ] ---------------------------------"
|
||||||
|
bench get-app erpnext https://github.com/frappe/erpnext
|
||||||
|
bench --site site1.local install-app erpnext
|
||||||
|
echo "----------------------- [ bench update ] ---------------------------------"
|
||||||
|
bench update
|
||||||
|
|
@ -43,7 +43,8 @@ services:
|
||||||
|
|
||||||
frappe:
|
frappe:
|
||||||
volumes:
|
volumes:
|
||||||
- ./frappe-bench:/home/frappe/frappe-bench
|
- ./frappe-bench/apps:/home/frappe/frappe-bench/apps
|
||||||
|
- ./frappe-bench/sites:/home/frappe/frappe-bench/sites
|
||||||
build: .
|
build: .
|
||||||
ports:
|
ports:
|
||||||
- "8000:8000" #webserver_port
|
- "8000:8000" #webserver_port
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue