2
0
mirror of https://github.com/frappe/frappe_docker.git synced 2024-11-09 14:50:58 +00:00

Merge pull request #104 from chabad360/install_app

Create a Wrapper script for installing custom apps
This commit is contained in:
Revant Nandgaonkar 2020-03-07 05:37:32 +05:30 committed by GitHub
commit 01d487b720
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 300 additions and 264 deletions

View File

@ -18,95 +18,95 @@ before_install:
after_success:
- docker --version
matrix:
jobs:
include:
- name: "Build Frappe bench development environment (latest)"
- stage: "Build Frappe bench development environment (latest)"
if: branch = develop AND type != pull_request
script:
- docker build -t frappe/bench:latest -f build/bench/Dockerfile .
- docker push frappe/bench:latest
- name: "Build Frappe python environment (edge)"
- stage: "Frappe (edge)"
if: branch = develop AND type != pull_request
script:
- ./travis.py frappe --worker --tag edge
- ./travis.py frappe --worker --tag develop--tag-only
- stage: "Frappe (edge)"
if: branch = develop AND type != pull_request
script:
- ./travis.py frappe --nginx --tag edge
- ./travis.py frappe --nginx --tag develop--tag-only
- name: "Build Frappe nginx + static assets (edge)"
if: branch = develop AND type != pull_request
script:
- ./travis.py frappe --nginx --tag edge
- ./travis.py frappe --nginx --tag develop--tag-only
- name: "Build ERPNext python environment (edge)"
if: branch = develop AND type != pull_request
script:
- ./travis.py erpnext --worker --tag edge
- ./travis.py erpnext --worker --tag develop --tag-only
- name: "Build ERPNext nginx + static assets (edge)"
if: branch = develop AND type != pull_request
script:
- ./travis.py erpnext --nginx --tag edge
- ./travis.py erpnext --nginx --tag develop --tag-only
- name: "Build Frappe socketio service (edge)"
- stage: "Frappe (edge)"
if: branch = develop AND type != pull_request
script:
- ./travis.py frappe --socketio --tag edge
- ./travis.py frappe --socketio --tag develop --tag-only
- name: "Build Frappe python environment (v12)"
- stage: "ERPNext (edge)"
if: branch = develop AND type != pull_request
script:
- ./travis.py erpnext --worker --tag edge
- ./travis.py erpnext --worker --tag develop --tag-only
- stage: "ERPNext (edge)"
if: branch = develop AND type != pull_request
script:
- ./travis.py erpnext --nginx --tag edge
- ./travis.py erpnext --nginx --tag develop --tag-only
- stage: "Frappe (v12)"
if: branch = master AND type != pull_request
script:
- ./travis.py frappe --worker --git-branch 12
- ./travis.py frappe --worker --tag v12 --tag-only
- ./travis.py frappe --worker --tag version-12 --tag-only
- name: "Build Frappe nginx + static assets (v12)"
- stage: "Frappe (v12)"
if: branch = master AND type != pull_request
script:
- ./travis.py frappe --nginx --git-branch 12
- ./travis.py frappe --nginx --tag v12 --tag-only
- ./travis.py frappe --nginx --tag version-12 --tag-only
- name: "Build ERPNext python environment (v12)"
- stage: "Frappe (v12)"
if: branch = master AND type != pull_request
script:
- ./travis.py frappe --socketio --git-branch 12
- ./travis.py frappe --socketio --tag v12 --tag-only
- ./travis.py frappe --socketio --tag version-12 --tag-only
- stage: "ERPNext (v12)"
if: branch = master AND type != pull_request
script:
- ./travis.py erpnext --worker --git-branch 12
- ./travis.py erpnext --worker --tag v12 --tag-only
- ./travis.py erpnext --worker --tag version-12 --tag-only
- name: "Build ERPNext nginx + static assets (v12)"
- stage: "ERPNext (v12)"
if: branch = master AND type != pull_request
script:
- ./travis.py erpnext --nginx --git-branch 12
- ./travis.py erpnext --nginx --tag v12 --tag-only
- ./travis.py erpnext --nginx --tag version-12 --tag-only
- name: "Build Frappe socketio service (v11)"
if: branch = master AND type != pull_request
script:
- ./travis.py frappe --socketio --git-branch 11
- ./travis.py frappe --socketio --tag v11 --tag-only
- ./travis.py frappe --socketio --tag version-11 --tag-only
- name: "Build Frappe python environment (v11)"
- stage: "Frappe (v11)"
if: branch = master AND type != pull_request
script:
- ./travis.py frappe --worker --git-branch 11
- ./travis.py frappe --worker --tag v11 --tag-only
- ./travis.py frappe --worker --tag version-11 --tag-only
- name: "Build Frappe nginx + static assets (v11)"
- stage: "Frappe (v11)"
if: branch = master AND type != pull_request
script:
- ./travis.py erpnext frappe --nginx --git-branch 11
- ./travis.py erpnext frappe --nginx --tag v11 --tag-only
- ./travis.py erpnext frappe --nginx --tag version-11 --tag-only
- name: "Build ERPNext python environment (v11)"
if: branch = master AND type != pull_request
script:
- ./travis.py erpnext --worker --git-branch 11
- ./travis.py erpnext --worker --tag v11 --tag-only
- ./travis.py erpnext --worker --tag version-11 --tag-only
- name: "Build ERPNext nginx + static assets (v11)"
if: branch = master AND type != pull_request
script:
- ./travis.py erpnext --nginx --git-branch 11
- ./travis.py erpnext --nginx --tag v11 --tag-only
- ./travis.py erpnext --nginx --tag version-11 --tag-only
- name: "Build Frappe socketio service (v11)"
- stage: "Frappe (v11)"
if: branch = master AND type != pull_request
script:
- ./travis.py frappe --socketio --git-branch 11
- ./travis.py frappe --socketio --tag v11 --tag-only
- ./travis.py frappe --socketio --tag version-11 --tag-only
- stage: "ERPNext (v11)"
if: branch = master AND type != pull_request
script:
- ./travis.py erpnext --worker --git-branch 11
- ./travis.py erpnext --worker --tag v11 --tag-only
- ./travis.py erpnext --worker --tag version-11 --tag-only
- stage: "ERPNext (v11)"
if: branch = master AND type != pull_request
script:
- ./travis.py erpnext --nginx --git-branch 11
- ./travis.py erpnext --nginx --tag v11 --tag-only
- ./travis.py erpnext --nginx --tag version-11 --tag-only

View File

@ -196,7 +196,7 @@ docker exec -it \
-e "DB_ROOT_USER=$DB_ROOT_USER" \
-e "MYSQL_ROOT_PASSWORD=$MYSQL_ROOT_PASSWORD" \
-e "ADMIN_PASSWORD=$ADMIN_PASSWORD" \
-e "INSTALL_ERPNEXT=1" \
-e "INSTALL_APPS='erpnext'" \
<project-name>_erpnext-python_1 docker-entrypoint.sh new
```
@ -206,7 +206,7 @@ Environment Variables needed:
- `DB_ROOT_USER`: MariaDB Root user. The user that can create databases.
- `MYSQL_ROOT_PASSWORD`: In case of mariadb docker container use the one set in `MYSQL_ROOT_PASSWORD` in previous steps. In case of managed database use appropriate password.
- `ADMIN_PASSWORD`: set the administrator password for new site.
- `INSTALL_ERPNEXT=1`: available only in erpnext-worker and erpnext containers. Installs ERPNext on this new site.
- `INSTALL_APPS='erpnext'`: available only in erpnext-worker and erpnext containers (or other containers with custom apps). Installs ERPNext (and/or the specified apps, comma-delinieated) on this new site.
- `FORCE=1`: is optional variable which force installs the same site.
#### Backup Sites
@ -252,6 +252,63 @@ docker exec -it \
<project-name>_erpnext-python_1 docker-entrypoint.sh migrate
```
### Custom apps
> For the sake of example, we'll be using a place holder called `[custom]`, and we'll be building off the edge image.
To add your own apps to the image, we'll need to create a custom image with the help of a special wrapper script
1. Create two folders called `[custom]-worker` and `[custom]-nginx` in the `build` folder.
```bash
cd frappe_docker
mkdir ./build/[custom]-worker ./build/[custom]-nginx
```
2. Create a `Dockerfile` in `./build/[custom]-worker` with the following content:
```Dockerfile
FROM frappe/erpnext-worker:edge
RUN install_app [custom] https://github.com/[username]/[custom] [branch]
# Only add the branch if you are using a specific tag or branch.
```
3. Create a `Dockerfile` in `./build/[custom]-nginx` with the following content:
```Dockerfile
FROM bitnami/node:12-prod
COPY build/[custom]-nginx/install_app.sh /install_app
RUN /install_app [custom] https://github.com/[username]/[custom]
FROM frappe/erpnext-nginx:edge
COPY --from=0 /home/frappe/frappe-bench/sites/ /var/www/html/
COPY --from=0 /rsync /rsync
RUN echo -n "\n[custom]" >> /var/www/html/apps.txt
VOLUME [ "/assets" ]
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["nginx", "-g", "daemon off;"]
```
4. Copy over the `install_app.sh` file from `./build/erpnext-nginx`
```bash
cp ./build/erpnext-nginx/install.sh ./build/[custom]-nginx
```
5. Open up `./installation/docker-compose-custom.yml` and replace all instances of `[app]` with the name of your app.
```bash
sed -i "s#\[app\]#[custom]#" ./installation/docker-compose-custom.yml
```
6. Install like usuall, except that when you set the `INSTALL_APPS` variable set it to `erpnext,[custom]`.
## Troubleshoot
1. Remove containers and volumes, and clear redis cache:

View File

@ -6,7 +6,7 @@ site_name = os.environ.get("SITE_NAME", 'site1.localhost')
mariadb_root_username = os.environ.get("DB_ROOT_USER", 'root')
mariadb_root_password = os.environ.get("MYSQL_ROOT_PASSWORD", 'admin')
force = True if os.environ.get("FORCE", None) else False
install_apps = ['erpnext'] if os.environ.get("INSTALL_ERPNEXT", None) else []
install_apps = if os.environ.get("INSTALL_APPS").split(",") else []
frappe.init(site_name, new_site=True)
_new_site(

View File

@ -0,0 +1,16 @@
#!/bin/bash
APP_NAME=${1}
APP_REPO=${2}
APP_BRANCH=${3}
cd /home/frappe/frappe-bench/
. env/bin/activate
cd ./apps
[ "${APP_BRANCH}" ] && BRANCH="-b ${APP_BRANCH}"
git clone --depth 1 -o upstream ${APP_REPO} ${BRANCH}
pip3 install --no-cache-dir -e /home/frappe/frappe-bench/apps/${APP_NAME}

View File

@ -1,38 +1,14 @@
FROM bitnami/node:12-prod
WORKDIR /home/frappe/frappe-bench
RUN mkdir -p /home/frappe/frappe-bench/sites \
&& echo "frappe\nerpnext" > /home/frappe/frappe-bench/sites/apps.txt
COPY build/erpnext-nginx/install_app.sh /install_app
RUN install_packages git python2
RUN /install_app erpnext https://github.com/frappe/erpnext
RUN mkdir -p apps sites/assets \
&& cd apps \
&& git clone --depth 1 https://github.com/frappe/frappe \
&& git clone --depth 1 https://github.com/frappe/erpnext
FROM frappe/frappe-nginx:develop
RUN cd /home/frappe/frappe-bench/apps/frappe \
&& yarn \
&& yarn run production \
&& rm -fr node_modules \
&& yarn install --production=true
RUN git clone --depth 1 https://github.com/frappe/bench /tmp/bench \
&& mkdir -p /var/www/error_pages \
&& cp -r /tmp/bench/bench/config/templates/502.html /var/www/error_pages
RUN cp -R /home/frappe/frappe-bench/apps/frappe/frappe/public/* /home/frappe/frappe-bench/sites/assets/frappe \
&& cp -R /home/frappe/frappe-bench/apps/frappe/node_modules /home/frappe/frappe-bench/sites/assets/frappe/ \
&& mkdir -p /home/frappe/frappe-bench/sites/assets/erpnext \
&& cp -R /home/frappe/frappe-bench/apps/erpnext/erpnext/public/* /home/frappe/frappe-bench/sites/assets/erpnext
FROM nginx:latest
COPY --from=0 /home/frappe/frappe-bench/sites /var/www/html/
COPY --from=0 /var/www/error_pages /var/www/
COPY build/common/nginx-default.conf.template /etc/nginx/conf.d/default.conf.template
COPY build/erpnext-nginx/docker-entrypoint.sh /
RUN apt-get update && apt-get install -y rsync && apt-get clean
COPY --from=0 /home/frappe/frappe-bench/sites/ /var/www/html/
COPY --from=0 /rsync /rsync
RUN echo -n "\nerpnext" >> /var/www/html/apps.txt
VOLUME [ "/assets" ]

View File

@ -9,7 +9,7 @@ set -e
rsync -a --delete /var/www/html/assets/js /assets
rsync -a --delete /var/www/html/assets/css /assets
rsync -a --delete /var/www/html/assets/frappe /assets
rsync -a --delete /var/www/html/assets/erpnext /assets
. /rsync
chmod -R 755 /assets

View File

@ -0,0 +1,31 @@
#!/bin/bash
APP_NAME=${1}
APP_REPO=${2}
APP_BRANCH=${3}
[ "${APP_BRANCH}" ] && BRANCH="-b ${APP_BRANCH}"
cd /home/frappe/frappe-bench
mkdir -p /home/frappe/frappe-bench/sites
echo "frappe\n${APP_NAME}" > /home/frappe/frappe-bench/sites/apps.txt
install_packages git python2
mkdir -p apps sites/assets
cd apps
git clone --depth 1 https://github.com/frappe/frappe ${BRANCH}
git clone --depth 1 ${APP_REPO} ${BRANCH}
cd /home/frappe/frappe-bench/apps/frappe
yarn
yarn production
rm -fr node_modules
yarn install --production=true
mkdir -p /home/frappe/frappe-bench/sites/assets/${APP_NAME}
cp -R /home/frappe/frappe-bench/apps/${APP_NAME}/${APP_NAME}/public/* /home/frappe/frappe-bench/sites/assets/${APP_NAME}
echo "rsync -a --delete /var/www/html/assets/${APP_NAME} /assets" > /rsync
rm /home/frappe/frappe-bench/sites/apps.txt

View File

@ -1,38 +1,14 @@
FROM bitnami/node:10-prod
WORKDIR /home/frappe/frappe-bench
RUN mkdir -p /home/frappe/frappe-bench/sites \
&& echo "frappe\nerpnext" > /home/frappe/frappe-bench/sites/apps.txt
COPY build/erpnext-nginx/install_app.sh /install_app
RUN install_packages git python2
RUN /install_app erpnext https://github.com/frappe/erpnext version-11
RUN mkdir -p apps sites/assets \
&& cd apps \
&& git clone --depth 1 https://github.com/frappe/frappe --branch version-11 \
&& git clone --depth 1 https://github.com/frappe/erpnext --branch version-11
FROM frappe/frappe-nginx:v11
RUN cd /home/frappe/frappe-bench/apps/frappe \
&& yarn \
&& yarn run production \
&& rm -fr node_modules \
&& yarn install --production=true
RUN git clone --depth 1 https://github.com/frappe/bench /tmp/bench \
&& mkdir -p /var/www/error_pages \
&& cp -r /tmp/bench/bench/config/templates/502.html /var/www/error_pages
RUN cp -R /home/frappe/frappe-bench/apps/frappe/frappe/public/* /home/frappe/frappe-bench/sites/assets/frappe \
&& cp -R /home/frappe/frappe-bench/apps/frappe/node_modules /home/frappe/frappe-bench/sites/assets/frappe/ \
&& mkdir -p /home/frappe/frappe-bench/sites/assets/erpnext \
&& cp -R /home/frappe/frappe-bench/apps/erpnext/erpnext/public/* /home/frappe/frappe-bench/sites/assets/erpnext
FROM nginx:latest
COPY --from=0 /home/frappe/frappe-bench/sites /var/www/html/
COPY --from=0 /var/www/error_pages /var/www/
COPY build/common/nginx-default.conf.template /etc/nginx/conf.d/default.conf.template
COPY build/erpnext-nginx/docker-entrypoint.sh /
RUN apt-get update && apt-get install -y rsync && apt-get clean
COPY --from=0 /home/frappe/frappe-bench/sites/ /var/www/html/
COPY --from=0 /rsync /rsync
RUN echo -n "\nerpnext" >> /home/frappe/frappe-bench/sites/apps.txt
VOLUME [ "/assets" ]

View File

@ -1,38 +1,14 @@
FROM bitnami/node:12-prod
WORKDIR /home/frappe/frappe-bench
RUN mkdir -p /home/frappe/frappe-bench/sites \
&& echo "frappe\nerpnext" > /home/frappe/frappe-bench/sites/apps.txt
COPY build/erpnext-nginx/install_app.sh /install_app
RUN install_packages git python2
RUN /install_app erpnext https://github.com/frappe/erpnext version-12
RUN mkdir -p apps sites/assets \
&& cd apps \
&& git clone --depth 1 https://github.com/frappe/frappe --branch version-12 \
&& git clone --depth 1 https://github.com/frappe/erpnext --branch version-12
FROM frappe/frappe-nginx:v12
RUN cd /home/frappe/frappe-bench/apps/frappe \
&& yarn \
&& yarn run production \
&& rm -fr node_modules \
&& yarn install --production=true
RUN git clone --depth 1 https://github.com/frappe/bench /tmp/bench \
&& mkdir -p /var/www/error_pages \
&& cp -r /tmp/bench/bench/config/templates/502.html /var/www/error_pages
RUN cp -R /home/frappe/frappe-bench/apps/frappe/frappe/public/* /home/frappe/frappe-bench/sites/assets/frappe \
&& cp -R /home/frappe/frappe-bench/apps/frappe/node_modules /home/frappe/frappe-bench/sites/assets/frappe/ \
&& mkdir -p /home/frappe/frappe-bench/sites/assets/erpnext \
&& cp -R /home/frappe/frappe-bench/apps/erpnext/erpnext/public/* /home/frappe/frappe-bench/sites/assets/erpnext
FROM nginx:latest
COPY --from=0 /home/frappe/frappe-bench/sites /var/www/html/
COPY --from=0 /var/www/error_pages /var/www/
COPY build/common/nginx-default.conf.template /etc/nginx/conf.d/default.conf.template
COPY build/erpnext-nginx/docker-entrypoint.sh /
RUN apt-get update && apt-get install -y rsync && apt-get clean
COPY --from=0 /home/frappe/frappe-bench/sites/ /var/www/html/
COPY --from=0 /rsync /rsync
RUN echo -n "\nerpnext" >> /home/frappe/frappe-bench/sites/apps.txt
VOLUME [ "/assets" ]

View File

@ -1,44 +1,3 @@
FROM bitnami/python:latest-prod
FROM frappe/frappe-worker:develop
RUN useradd -ms /bin/bash frappe
WORKDIR /home/frappe/frappe-bench
RUN install_packages \
git \
wkhtmltopdf \
mariadb-client \
gettext-base \
wget \
# for PDF
libssl-dev \
fonts-cantarell \
xfonts-75dpi \
xfonts-base \
# For psycopg2
libpq-dev \
build-essential
# 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
RUN mkdir -p apps logs commands
RUN virtualenv env \
&& . env/bin/activate \
&& cd apps \
&& git clone --depth 1 -o upstream https://github.com/frappe/frappe \
&& git clone --depth 1 -o upstream https://github.com/frappe/erpnext \
&& pip3 install --no-cache-dir -e /home/frappe/frappe-bench/apps/frappe \
&& pip3 install --no-cache-dir -e /home/frappe/frappe-bench/apps/erpnext
COPY build/common/commands/* /home/frappe/frappe-bench/commands/
COPY build/common/common_site_config.json.template /opt/frappe/common_site_config.json.template
# Setup docker-entrypoint
COPY build/common/worker/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
RUN ln -s /usr/local/bin/docker-entrypoint.sh / # backwards compat
WORKDIR /home/frappe/frappe-bench/sites
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["start"]
RUN install_app erpnext https://github.com/frappe/erpnext

View File

@ -1,41 +1,3 @@
FROM bitnami/python:latest-prod
FROM frappe/frappe-worker:v11
RUN useradd -ms /bin/bash frappe
WORKDIR /home/frappe/frappe-bench
RUN install_packages \
git \
wkhtmltopdf \
mariadb-client \
gettext-base \
wget \
# for PDF
libssl-dev \
fonts-cantarell \
xfonts-75dpi \
xfonts-base
# 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
RUN mkdir -p apps logs commands
RUN virtualenv env \
&& . env/bin/activate \
&& cd apps \
&& git clone --depth 1 -o upstream https://github.com/frappe/frappe --branch version-11 \
&& git clone --depth 1 -o upstream https://github.com/frappe/erpnext --branch version-11 \
&& pip3 install --no-cache-dir -e /home/frappe/frappe-bench/apps/frappe \
&& pip3 install --no-cache-dir -e /home/frappe/frappe-bench/apps/erpnext
COPY build/common/commands/* /home/frappe/frappe-bench/commands/
COPY build/common/common_site_config.json.template /opt/frappe/common_site_config.json.template
# Setup docker-entrypoint
COPY build/common/worker/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
RUN ln -s /usr/local/bin/docker-entrypoint.sh / # backwards compat
WORKDIR /home/frappe/frappe-bench/sites
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["start"]
RUN install_app erpnext https://github.com/frappe/erpnext version-11

View File

@ -1,44 +1,3 @@
FROM bitnami/python:latest-prod
FROM frappe/frappe-worker:v12
RUN useradd -ms /bin/bash frappe
WORKDIR /home/frappe/frappe-bench
RUN install_packages \
git \
wkhtmltopdf \
mariadb-client \
gettext-base \
wget \
# for PDF
libssl-dev \
fonts-cantarell \
xfonts-75dpi \
xfonts-base \
# For psycopg2
libpq-dev \
build-essential
# 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
RUN mkdir -p apps logs commands
RUN virtualenv env \
&& . env/bin/activate \
&& cd apps \
&& git clone --depth 1 -o upstream https://github.com/frappe/frappe --branch version-12 \
&& git clone --depth 1 -o upstream https://github.com/frappe/erpnext --branch version-12 \
&& pip3 install --no-cache-dir -e /home/frappe/frappe-bench/apps/frappe \
&& pip3 install --no-cache-dir -e /home/frappe/frappe-bench/apps/erpnext
COPY build/common/commands/* /home/frappe/frappe-bench/commands/
COPY build/common/common_site_config.json.template /opt/frappe/common_site_config.json.template
# Setup docker-entrypoint
COPY build/common/worker/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
RUN ln -s /usr/local/bin/docker-entrypoint.sh / # backwards compat
WORKDIR /home/frappe/frappe-bench/sites
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["start"]
RUN install_app erpnext https://github.com/frappe/erpnext version-12

View File

@ -9,6 +9,7 @@ set -e
rsync -a --delete /var/www/html/assets/js /assets
rsync -a --delete /var/www/html/assets/css /assets
rsync -a --delete /var/www/html/assets/frappe /assets
. /rsync
chmod -R 755 /assets

View File

@ -36,6 +36,8 @@ COPY build/common/common_site_config.json.template /opt/frappe/common_site_confi
COPY build/common/worker/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
RUN ln -s /usr/local/bin/docker-entrypoint.sh / # backwards compat
COPY build/common/worker/install_app.sh /usr/local/bin/install_app
WORKDIR /home/frappe/frappe-bench/sites
ENTRYPOINT ["docker-entrypoint.sh"]

View File

@ -33,6 +33,8 @@ COPY build/common/common_site_config.json.template /opt/frappe/common_site_confi
COPY build/common/worker/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
RUN ln -s /usr/local/bin/docker-entrypoint.sh / # backwards compat
COPY build/common/worker/install_app.sh /usr/local/bin/install_app
WORKDIR /home/frappe/frappe-bench/sites
ENTRYPOINT ["docker-entrypoint.sh"]

View File

@ -36,6 +36,8 @@ COPY build/common/common_site_config.json.template /opt/frappe/common_site_confi
COPY build/common/worker/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
RUN ln -s /usr/local/bin/docker-entrypoint.sh / # backwards compat
COPY build/common/worker/install_app.sh /usr/local/bin/install_app
WORKDIR /home/frappe/frappe-bench/sites
ENTRYPOINT ["docker-entrypoint.sh"]

View File

@ -0,0 +1,117 @@
version: '3'
services:
[app]-assets:
image: [app]-assets
build:
context: .
dockerfile: ./build/[app]-assets/Dockerfile
restart: on-failure
environment:
- FRAPPE_PY=erpnext-python
- FRAPPE_PY_PORT=8000
- FRAPPE_SOCKETIO=frappe-socketio
- SOCKETIO_PORT=9000
- LETSENCRYPT_HOST=${SITES}
- VIRTUAL_HOST=${SITES}
- LETSENCRYPT_EMAIL=${LETSENCRYPT_EMAIL}
depends_on:
- [app]-python
- frappe-socketio
- frappe-worker-default
- frappe-worker-long
- frappe-worker-short
links:
- [app]-python
- frappe-socketio
- frappe-worker-default
- frappe-worker-long
- frappe-worker-short
volumes:
- ./sites:/var/www/html/sites:rw
- assets-vol:/assets:rw
[app]-python:
image: [app]-worker
build:
context: .
dockerfile: ./build/[app]-worker/Dockerfile
restart: on-failure
environment:
- MARIADB_HOST=${MARIADB_HOST}
- REDIS_CACHE=redis-cache:6379
- REDIS_QUEUE=redis-queue:6379
- REDIS_SOCKETIO=redis-socketio:6379
- SOCKETIO_PORT=9000
volumes:
- ./sites:/home/frappe/frappe-bench/sites:rw
- assets-vol:/home/frappe/frappe-bench/sites/assets:rw
frappe-socketio:
image: frappe/frappe-socketio:${VERSION}
restart: on-failure
depends_on:
- redis-socketio
links:
- redis-socketio
volumes:
- ./sites:/home/frappe/frappe-bench/sites:rw
frappe-worker-default:
image: [app]-worker
restart: on-failure
command: worker
depends_on:
- redis-queue
- redis-cache
links:
- redis-queue
- redis-cache
volumes:
- ./sites:/home/frappe/frappe-bench/sites:rw
frappe-worker-short:
image: [app]-worker
restart: on-failure
command: worker
environment:
- WORKER_TYPE=short
depends_on:
- redis-queue
- redis-cache
links:
- redis-queue
- redis-cache
volumes:
- ./sites:/home/frappe/frappe-bench/sites:rw
frappe-worker-long:
image: [app]-worker
restart: on-failure
command: worker
environment:
- WORKER_TYPE=long
depends_on:
- redis-queue
- redis-cache
links:
- redis-queue
- redis-cache
volumes:
- ./sites:/home/frappe/frappe-bench/sites:rw
frappe-schedule:
image: [app]-worker
restart: on-failure
command: schedule
depends_on:
- redis-queue
- redis-cache
links:
- redis-queue
- redis-cache
volumes:
- ./sites:/home/frappe/frappe-bench/sites:rw
volumes:
assets-vol: