mirror of
https://github.com/frappe/frappe_docker.git
synced 2026-06-27 09:15:10 +00:00
Merge pull request #421 from frappe/develop
Release: ERPNext v12.18.0 and Frappe Framework v12.15.0
This commit is contained in:
commit
34f7702c75
14 changed files with 126 additions and 104 deletions
|
|
@ -6,6 +6,12 @@ upstream socketio-server {
|
||||||
server ${FRAPPE_SOCKETIO}:${SOCKETIO_PORT} fail_timeout=0;
|
server ${FRAPPE_SOCKETIO}:${SOCKETIO_PORT} fail_timeout=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Parse the X-Forwarded-Proto header - if set - defaulting to $scheme.
|
||||||
|
map $http_x_forwarded_proto $proxy_x_forwarded_proto {
|
||||||
|
default $scheme;
|
||||||
|
https https;
|
||||||
|
}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
server_name $http_host;
|
server_name $http_host;
|
||||||
|
|
@ -16,6 +22,12 @@ server {
|
||||||
add_header X-Content-Type-Options nosniff;
|
add_header X-Content-Type-Options nosniff;
|
||||||
add_header X-XSS-Protection "1; mode=block";
|
add_header X-XSS-Protection "1; mode=block";
|
||||||
|
|
||||||
|
# Define ${UPSTREAM_REAL_IP_ADDRESS} as our trusted upstream address, so we will be using
|
||||||
|
# its ${UPSTREAM_REAL_IP_HEADER} address as our remote address
|
||||||
|
set_real_ip_from ${UPSTREAM_REAL_IP_ADDRESS};
|
||||||
|
real_ip_header ${UPSTREAM_REAL_IP_HEADER};
|
||||||
|
real_ip_recursive ${UPSTREAM_REAL_IP_RECURSIVE};
|
||||||
|
|
||||||
location /assets {
|
location /assets {
|
||||||
try_files $uri =404;
|
try_files $uri =404;
|
||||||
}
|
}
|
||||||
|
|
@ -27,10 +39,12 @@ server {
|
||||||
|
|
||||||
location /socket.io {
|
location /socket.io {
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $proxy_x_forwarded_proto;
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
proxy_set_header Connection "upgrade";
|
proxy_set_header Connection "upgrade";
|
||||||
proxy_set_header X-Frappe-Site-Name $host;
|
proxy_set_header X-Frappe-Site-Name $host;
|
||||||
proxy_set_header Origin $scheme://$http_host;
|
proxy_set_header Origin $proxy_x_forwarded_proto://$http_host;
|
||||||
proxy_set_header Host $http_host;
|
proxy_set_header Host $http_host;
|
||||||
|
|
||||||
proxy_pass http://socketio-server;
|
proxy_pass http://socketio-server;
|
||||||
|
|
@ -50,8 +64,8 @@ server {
|
||||||
}
|
}
|
||||||
|
|
||||||
location @webserver {
|
location @webserver {
|
||||||
proxy_set_header X-Forwarded-For $remote_addr;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
proxy_set_header X-Forwarded-Proto $proxy_x_forwarded_proto;
|
||||||
proxy_set_header X-Frappe-Site-Name $host;
|
proxy_set_header X-Frappe-Site-Name $host;
|
||||||
proxy_set_header Host $http_host;
|
proxy_set_header Host $http_host;
|
||||||
proxy_set_header X-Use-X-Accel-Redirect True;
|
proxy_set_header X-Use-X-Accel-Redirect True;
|
||||||
|
|
|
||||||
|
|
@ -46,8 +46,8 @@ function configureEnv() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkConnection() {
|
function checkConnection() {
|
||||||
su frappe -c ". /home/frappe/frappe-bench/env/bin/activate \
|
. /home/frappe/frappe-bench/env/bin/activate \
|
||||||
&& python /home/frappe/frappe-bench/commands/check_connection.py"
|
&& python /home/frappe/frappe-bench/commands/check_connection.py
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkConfigExists() {
|
function checkConfigExists() {
|
||||||
|
|
@ -68,9 +68,6 @@ if [[ ! -e /home/frappe/frappe-bench/sites/apps.txt ]]; then
|
||||||
find /home/frappe/frappe-bench/apps -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | sort -r > /home/frappe/frappe-bench/sites/apps.txt
|
find /home/frappe/frappe-bench/apps -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | sort -r > /home/frappe/frappe-bench/sites/apps.txt
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Allow user process to create files in logs directory
|
|
||||||
chown -R frappe:frappe /home/frappe/frappe-bench/logs
|
|
||||||
|
|
||||||
# symlink node_modules
|
# symlink node_modules
|
||||||
ln -sfn /home/frappe/frappe-bench/sites/assets/frappe/node_modules \
|
ln -sfn /home/frappe/frappe-bench/sites/assets/frappe/node_modules \
|
||||||
/home/frappe/frappe-bench/apps/frappe/node_modules
|
/home/frappe/frappe-bench/apps/frappe/node_modules
|
||||||
|
|
@ -79,8 +76,6 @@ if [ "$1" = 'start' ]; then
|
||||||
configureEnv
|
configureEnv
|
||||||
checkConnection
|
checkConnection
|
||||||
|
|
||||||
chown frappe:frappe /home/frappe/frappe-bench/sites/common_site_config.json
|
|
||||||
|
|
||||||
if [[ -z "$WORKERS" ]]; then
|
if [[ -z "$WORKERS" ]]; then
|
||||||
export WORKERS=2
|
export WORKERS=2
|
||||||
fi
|
fi
|
||||||
|
|
@ -90,99 +85,67 @@ if [ "$1" = 'start' ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ! -z "$AUTO_MIGRATE" ]]; then
|
if [[ ! -z "$AUTO_MIGRATE" ]]; then
|
||||||
su frappe -c ". /home/frappe/frappe-bench/env/bin/activate \
|
. /home/frappe/frappe-bench/env/bin/activate \
|
||||||
&& python /home/frappe/frappe-bench/commands/auto_migrate.py"
|
&& python /home/frappe/frappe-bench/commands/auto_migrate.py
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -z "$RUN_AS_ROOT" ]]; then
|
. /home/frappe/frappe-bench/env/bin/activate
|
||||||
su frappe -c ". /home/frappe/frappe-bench/env/bin/activate \
|
gunicorn -b 0.0.0.0:$FRAPPE_PORT \
|
||||||
&& gunicorn -b 0.0.0.0:$FRAPPE_PORT \
|
--worker-tmp-dir /dev/shm \
|
||||||
--worker-tmp-dir /dev/shm \
|
--threads=4 \
|
||||||
--threads=4 \
|
--workers $WORKERS \
|
||||||
--workers $WORKERS \
|
--worker-class=gthread \
|
||||||
--worker-class=gthread \
|
--log-file=- \
|
||||||
--log-file=- \
|
-t 120 frappe.app:application --preload
|
||||||
-t 120 frappe.app:application --preload"
|
|
||||||
else
|
|
||||||
. /home/frappe/frappe-bench/env/bin/activate
|
|
||||||
gunicorn -b 0.0.0.0:$FRAPPE_PORT \
|
|
||||||
--worker-tmp-dir /dev/shm \
|
|
||||||
--threads=4 \
|
|
||||||
--workers $WORKERS \
|
|
||||||
--worker-class=gthread \
|
|
||||||
--log-file=- \
|
|
||||||
-t 120 frappe.app:application --preload
|
|
||||||
fi
|
|
||||||
|
|
||||||
elif [ "$1" = 'worker' ]; then
|
elif [ "$1" = 'worker' ]; then
|
||||||
checkConfigExists
|
checkConfigExists
|
||||||
checkConnection
|
checkConnection
|
||||||
# default WORKER_TYPE=default
|
# default WORKER_TYPE=default
|
||||||
if [[ -z "$RUN_AS_ROOT" ]]; then
|
|
||||||
su frappe -c ". /home/frappe/frappe-bench/env/bin/activate \
|
. /home/frappe/frappe-bench/env/bin/activate
|
||||||
&& python /home/frappe/frappe-bench/commands/worker.py"
|
python /home/frappe/frappe-bench/commands/worker.py
|
||||||
else
|
|
||||||
. /home/frappe/frappe-bench/env/bin/activate
|
|
||||||
python /home/frappe/frappe-bench/commands/worker.py
|
|
||||||
fi
|
|
||||||
|
|
||||||
elif [ "$1" = 'schedule' ]; then
|
elif [ "$1" = 'schedule' ]; then
|
||||||
checkConfigExists
|
checkConfigExists
|
||||||
checkConnection
|
checkConnection
|
||||||
if [[ -z "$RUN_AS_ROOT" ]]; then
|
|
||||||
su frappe -c ". /home/frappe/frappe-bench/env/bin/activate \
|
. /home/frappe/frappe-bench/env/bin/activate
|
||||||
&& python /home/frappe/frappe-bench/commands/background.py"
|
python /home/frappe/frappe-bench/commands/background.py
|
||||||
else
|
|
||||||
. /home/frappe/frappe-bench/env/bin/activate
|
|
||||||
python /home/frappe/frappe-bench/commands/background.py
|
|
||||||
fi
|
|
||||||
|
|
||||||
elif [ "$1" = 'new' ]; then
|
elif [ "$1" = 'new' ]; then
|
||||||
checkConfigExists
|
checkConfigExists
|
||||||
checkConnection
|
checkConnection
|
||||||
if [[ -z "$RUN_AS_ROOT" ]]; then
|
|
||||||
su frappe -c ". /home/frappe/frappe-bench/env/bin/activate \
|
. /home/frappe/frappe-bench/env/bin/activate
|
||||||
&& python /home/frappe/frappe-bench/commands/new.py"
|
python /home/frappe/frappe-bench/commands/new.py
|
||||||
exit
|
exit
|
||||||
else
|
|
||||||
. /home/frappe/frappe-bench/env/bin/activate
|
|
||||||
python /home/frappe/frappe-bench/commands/new.py
|
|
||||||
fi
|
|
||||||
|
|
||||||
elif [ "$1" = 'drop' ]; then
|
elif [ "$1" = 'drop' ]; then
|
||||||
checkConfigExists
|
checkConfigExists
|
||||||
checkConnection
|
checkConnection
|
||||||
if [[ -z "$RUN_AS_ROOT" ]]; then
|
|
||||||
su frappe -c ". /home/frappe/frappe-bench/env/bin/activate \
|
. /home/frappe/frappe-bench/env/bin/activate
|
||||||
&& python /home/frappe/frappe-bench/commands/drop.py"
|
python /home/frappe/frappe-bench/commands/drop.py
|
||||||
exit
|
exit
|
||||||
else
|
|
||||||
. /home/frappe/frappe-bench/env/bin/activate
|
|
||||||
python /home/frappe/frappe-bench/commands/drop.py
|
|
||||||
fi
|
|
||||||
|
|
||||||
elif [ "$1" = 'migrate' ]; then
|
elif [ "$1" = 'migrate' ]; then
|
||||||
|
|
||||||
su frappe -c ". /home/frappe/frappe-bench/env/bin/activate \
|
. /home/frappe/frappe-bench/env/bin/activate \
|
||||||
&& python /home/frappe/frappe-bench/commands/migrate.py"
|
&& python /home/frappe/frappe-bench/commands/migrate.py
|
||||||
exit
|
exit
|
||||||
|
|
||||||
elif [ "$1" = 'doctor' ]; then
|
elif [ "$1" = 'doctor' ]; then
|
||||||
|
|
||||||
su frappe -c ". /home/frappe/frappe-bench/env/bin/activate \
|
. /home/frappe/frappe-bench/env/bin/activate \
|
||||||
&& python /home/frappe/frappe-bench/commands/doctor.py ${@:2}"
|
&& python /home/frappe/frappe-bench/commands/doctor.py ${@:2}
|
||||||
exit
|
exit
|
||||||
|
|
||||||
elif [ "$1" = 'backup' ]; then
|
elif [ "$1" = 'backup' ]; then
|
||||||
|
|
||||||
if [[ -z "$RUN_AS_ROOT" ]]; then
|
. /home/frappe/frappe-bench/env/bin/activate
|
||||||
su frappe -c ". /home/frappe/frappe-bench/env/bin/activate \
|
python /home/frappe/frappe-bench/commands/backup.py
|
||||||
&& python /home/frappe/frappe-bench/commands/backup.py"
|
exit
|
||||||
exit
|
|
||||||
else
|
|
||||||
. /home/frappe/frappe-bench/env/bin/activate
|
|
||||||
python /home/frappe/frappe-bench/commands/backup.py
|
|
||||||
fi
|
|
||||||
|
|
||||||
elif [ "$1" = 'console' ]; then
|
elif [ "$1" = 'console' ]; then
|
||||||
|
|
||||||
|
|
@ -192,25 +155,20 @@ elif [ "$1" = 'console' ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -z "$RUN_AS_ROOT" ]]; then
|
. /home/frappe/frappe-bench/env/bin/activate
|
||||||
su frappe -c ". /home/frappe/frappe-bench/env/bin/activate \
|
python /home/frappe/frappe-bench/commands/console.py "$2"
|
||||||
&& python /home/frappe/frappe-bench/commands/console.py $2"
|
exit
|
||||||
exit
|
|
||||||
else
|
|
||||||
. /home/frappe/frappe-bench/env/bin/activate
|
|
||||||
python /home/frappe/frappe-bench/commands/console.py "$2"
|
|
||||||
fi
|
|
||||||
|
|
||||||
elif [ "$1" = 'push-backup' ]; then
|
elif [ "$1" = 'push-backup' ]; then
|
||||||
|
|
||||||
su frappe -c ". /home/frappe/frappe-bench/env/bin/activate \
|
. /home/frappe/frappe-bench/env/bin/activate \
|
||||||
&& python /home/frappe/frappe-bench/commands/push_backup.py"
|
&& python /home/frappe/frappe-bench/commands/push_backup.py
|
||||||
exit
|
exit
|
||||||
|
|
||||||
elif [ "$1" = 'restore-backup' ]; then
|
elif [ "$1" = 'restore-backup' ]; then
|
||||||
|
|
||||||
su frappe -c ". /home/frappe/frappe-bench/env/bin/activate \
|
. /home/frappe/frappe-bench/env/bin/activate \
|
||||||
&& python /home/frappe/frappe-bench/commands/restore_backup.py"
|
&& python /home/frappe/frappe-bench/commands/restore_backup.py
|
||||||
exit
|
exit
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -15,9 +15,20 @@ cd apps
|
||||||
git clone --depth 1 https://github.com/frappe/frappe ${BRANCH}
|
git clone --depth 1 https://github.com/frappe/frappe ${BRANCH}
|
||||||
git clone --depth 1 ${APP_REPO} ${BRANCH} ${APP_NAME}
|
git clone --depth 1 ${APP_REPO} ${BRANCH} ${APP_NAME}
|
||||||
|
|
||||||
|
echo "Install frappe NodeJS dependencies . . ."
|
||||||
cd /home/frappe/frappe-bench/apps/frappe
|
cd /home/frappe/frappe-bench/apps/frappe
|
||||||
yarn
|
yarn
|
||||||
|
echo "Install ${APP_NAME} NodeJS dependencies . . ."
|
||||||
|
cd /home/frappe/frappe-bench/apps/${APP_NAME}
|
||||||
|
yarn
|
||||||
|
echo "Build browser assets . . ."
|
||||||
|
cd /home/frappe/frappe-bench/apps/frappe
|
||||||
yarn production --app ${APP_NAME}
|
yarn production --app ${APP_NAME}
|
||||||
|
echo "Install frappe NodeJS production dependencies . . ."
|
||||||
|
cd /home/frappe/frappe-bench/apps/frappe
|
||||||
|
yarn install --production=true
|
||||||
|
echo "Install ${APP_NAME} NodeJS production dependencies . . ."
|
||||||
|
cd /home/frappe/frappe-bench/apps/${APP_NAME}
|
||||||
yarn install --production=true
|
yarn install --production=true
|
||||||
|
|
||||||
mkdir -p /home/frappe/frappe-bench/sites/assets/${APP_NAME}
|
mkdir -p /home/frappe/frappe-bench/sites/assets/${APP_NAME}
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,6 @@ 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/frappe /assets
|
||||||
. /rsync
|
. /rsync
|
||||||
|
|
||||||
chmod -R 755 /assets
|
|
||||||
|
|
||||||
touch /var/www/html/sites/.build -r $(ls -td /assets/* | head -n 1)
|
touch /var/www/html/sites/.build -r $(ls -td /assets/* | head -n 1)
|
||||||
|
|
||||||
if [[ -z "$FRAPPE_PY" ]]; then
|
if [[ -z "$FRAPPE_PY" ]]; then
|
||||||
|
|
@ -35,11 +33,26 @@ if [[ -z "$HTTP_TIMEOUT" ]]; then
|
||||||
export HTTP_TIMEOUT=120
|
export HTTP_TIMEOUT=120
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ -z "$UPSTREAM_REAL_IP_ADDRESS" ]]; then
|
||||||
|
export UPSTREAM_REAL_IP_ADDRESS=127.0.0.1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -z "$UPSTREAM_REAL_IP_RECURSIVE" ]]; then
|
||||||
|
export UPSTREAM_REAL_IP_RECURSIVE=off
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -z "$UPSTREAM_REAL_IP_HEADER" ]]; then
|
||||||
|
export UPSTREAM_REAL_IP_HEADER="X-Forwarded-For"
|
||||||
|
fi
|
||||||
|
|
||||||
envsubst '${FRAPPE_PY}
|
envsubst '${FRAPPE_PY}
|
||||||
${FRAPPE_PY_PORT}
|
${FRAPPE_PY_PORT}
|
||||||
${FRAPPE_SOCKETIO}
|
${FRAPPE_SOCKETIO}
|
||||||
${SOCKETIO_PORT}
|
${SOCKETIO_PORT}
|
||||||
${HTTP_TIMEOUT}' \
|
${HTTP_TIMEOUT}
|
||||||
|
${UPSTREAM_REAL_IP_ADDRESS}
|
||||||
|
${UPSTREAM_REAL_IP_RECURSIVE}
|
||||||
|
${UPSTREAM_REAL_IP_HEADER}' \
|
||||||
< /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf
|
< /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf
|
||||||
|
|
||||||
echo "Waiting for frappe-python to be available on $FRAPPE_PY port $FRAPPE_PY_PORT"
|
echo "Waiting for frappe-python to be available on $FRAPPE_PY port $FRAPPE_PY_PORT"
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,8 @@ RUN cd /home/frappe/frappe-bench/apps/frappe \
|
||||||
COPY build/frappe-socketio/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
|
COPY build/frappe-socketio/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
|
||||||
RUN ln -s /usr/local/bin/docker-entrypoint.sh / # backwards compat
|
RUN ln -s /usr/local/bin/docker-entrypoint.sh / # backwards compat
|
||||||
|
|
||||||
|
USER frappe
|
||||||
|
|
||||||
WORKDIR /home/frappe/frappe-bench/sites
|
WORKDIR /home/frappe/frappe-bench/sites
|
||||||
|
|
||||||
ENTRYPOINT ["docker-entrypoint.sh"]
|
ENTRYPOINT ["docker-entrypoint.sh"]
|
||||||
|
|
|
||||||
|
|
@ -16,14 +16,14 @@ function checkConfigExists() {
|
||||||
|
|
||||||
if [ "$1" = 'start' ]; then
|
if [ "$1" = 'start' ]; then
|
||||||
checkConfigExists
|
checkConfigExists
|
||||||
su frappe -c "node /home/frappe/frappe-bench/apps/frappe/socketio.js"
|
node /home/frappe/frappe-bench/apps/frappe/socketio.js
|
||||||
|
|
||||||
elif [ "$1" = 'doctor' ]; then
|
elif [ "$1" = 'doctor' ]; then
|
||||||
|
|
||||||
su frappe -c "node /home/frappe/frappe-bench/apps/frappe/health.js"
|
node /home/frappe/frappe-bench/apps/frappe/health.js
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
exec su frappe -c "$@"
|
exec -c "$@"
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,10 @@ RUN apt-get update -y && apt-get install \
|
||||||
&& wget https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh \
|
&& wget https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh \
|
||||||
&& chown -R frappe:frappe /home/frappe
|
&& chown -R frappe:frappe /home/frappe
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
||||||
USER frappe
|
USER frappe
|
||||||
# Install nvm with node
|
# Install nvm with node
|
||||||
RUN bash install.sh \
|
RUN bash install.sh \
|
||||||
|
|
@ -65,7 +69,6 @@ RUN python -m venv env \
|
||||||
&& git clone --depth 1 -o upstream https://github.com/frappe/frappe --branch ${GIT_BRANCH} \
|
&& git clone --depth 1 -o upstream https://github.com/frappe/frappe --branch ${GIT_BRANCH} \
|
||||||
&& pip3 install --no-cache-dir -e /home/frappe/frappe-bench/apps/frappe
|
&& pip3 install --no-cache-dir -e /home/frappe/frappe-bench/apps/frappe
|
||||||
|
|
||||||
USER root
|
|
||||||
# Copy scripts and templates
|
# Copy scripts and templates
|
||||||
COPY build/common/commands/* /home/frappe/frappe-bench/commands/
|
COPY build/common/commands/* /home/frappe/frappe-bench/commands/
|
||||||
COPY build/common/common_site_config.json.template /opt/frappe/common_site_config.json.template
|
COPY build/common/common_site_config.json.template /opt/frappe/common_site_config.json.template
|
||||||
|
|
@ -73,17 +76,10 @@ COPY build/common/worker/install_app.sh /usr/local/bin/install_app
|
||||||
COPY build/common/worker/bench /usr/local/bin/bench
|
COPY build/common/worker/bench /usr/local/bin/bench
|
||||||
COPY build/common/worker/healthcheck.sh /usr/local/bin/healthcheck.sh
|
COPY build/common/worker/healthcheck.sh /usr/local/bin/healthcheck.sh
|
||||||
|
|
||||||
# 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
|
|
||||||
|
|
||||||
# Use sites volume as working directory
|
# Use sites volume as working directory
|
||||||
WORKDIR /home/frappe/frappe-bench/sites
|
WORKDIR /home/frappe/frappe-bench/sites
|
||||||
|
|
||||||
# Set ownership of sites directory
|
VOLUME [ "/home/frappe/frappe-bench/sites", "/home/frappe/backups", "/home/frappe/frappe-bench/logs" ]
|
||||||
RUN chown -R frappe:frappe /home/frappe/frappe-bench/sites
|
|
||||||
|
|
||||||
VOLUME [ "/home/frappe/frappe-bench/sites", "/home/frappe/backups" ]
|
|
||||||
|
|
||||||
ENTRYPOINT ["docker-entrypoint.sh"]
|
ENTRYPOINT ["docker-entrypoint.sh"]
|
||||||
CMD ["start"]
|
CMD ["start"]
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,7 @@ services:
|
||||||
- redis-socketio
|
- redis-socketio
|
||||||
volumes:
|
volumes:
|
||||||
- sites-vol:/home/frappe/frappe-bench/sites:rw
|
- sites-vol:/home/frappe/frappe-bench/sites:rw
|
||||||
|
- logs-vol:/home/frappe/frappe-bench/logs:rw
|
||||||
|
|
||||||
erpnext-worker-default:
|
erpnext-worker-default:
|
||||||
image: frappe/erpnext-worker:${ERPNEXT_VERSION}
|
image: frappe/erpnext-worker:${ERPNEXT_VERSION}
|
||||||
|
|
@ -78,6 +79,7 @@ services:
|
||||||
- redis-cache
|
- redis-cache
|
||||||
volumes:
|
volumes:
|
||||||
- sites-vol:/home/frappe/frappe-bench/sites:rw
|
- sites-vol:/home/frappe/frappe-bench/sites:rw
|
||||||
|
- logs-vol:/home/frappe/frappe-bench/logs:rw
|
||||||
|
|
||||||
erpnext-worker-short:
|
erpnext-worker-short:
|
||||||
image: frappe/erpnext-worker:${ERPNEXT_VERSION}
|
image: frappe/erpnext-worker:${ERPNEXT_VERSION}
|
||||||
|
|
@ -90,6 +92,7 @@ services:
|
||||||
- redis-cache
|
- redis-cache
|
||||||
volumes:
|
volumes:
|
||||||
- sites-vol:/home/frappe/frappe-bench/sites:rw
|
- sites-vol:/home/frappe/frappe-bench/sites:rw
|
||||||
|
- logs-vol:/home/frappe/frappe-bench/logs:rw
|
||||||
|
|
||||||
erpnext-worker-long:
|
erpnext-worker-long:
|
||||||
image: frappe/erpnext-worker:${ERPNEXT_VERSION}
|
image: frappe/erpnext-worker:${ERPNEXT_VERSION}
|
||||||
|
|
@ -112,6 +115,7 @@ services:
|
||||||
- redis-cache
|
- redis-cache
|
||||||
volumes:
|
volumes:
|
||||||
- sites-vol:/home/frappe/frappe-bench/sites:rw
|
- sites-vol:/home/frappe/frappe-bench/sites:rw
|
||||||
|
- logs-vol:/home/frappe/frappe-bench/logs:rw
|
||||||
|
|
||||||
redis-cache:
|
redis-cache:
|
||||||
image: redis:latest
|
image: redis:latest
|
||||||
|
|
@ -154,6 +158,7 @@ services:
|
||||||
- INSTALL_APPS=${INSTALL_APPS}
|
- INSTALL_APPS=${INSTALL_APPS}
|
||||||
volumes:
|
volumes:
|
||||||
- sites-vol:/home/frappe/frappe-bench/sites:rw
|
- sites-vol:/home/frappe/frappe-bench/sites:rw
|
||||||
|
- logs-vol:/home/frappe/frappe-bench/logs:rw
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
mariadb-vol:
|
mariadb-vol:
|
||||||
|
|
@ -163,3 +168,4 @@ volumes:
|
||||||
assets-vol:
|
assets-vol:
|
||||||
sites-vol:
|
sites-vol:
|
||||||
cert-vol:
|
cert-vol:
|
||||||
|
logs-vol:
|
||||||
|
|
|
||||||
|
|
@ -142,6 +142,7 @@ services:
|
||||||
erpnext-nginx:
|
erpnext-nginx:
|
||||||
image: frappe/erpnext-nginx:${ERPNEXT_VERSION?Variable ERPNEXT_VERSION not set}
|
image: frappe/erpnext-nginx:${ERPNEXT_VERSION?Variable ERPNEXT_VERSION not set}
|
||||||
environment:
|
environment:
|
||||||
|
- UPSTREAM_REAL_IP_ADDRESS=10.0.0.0/8
|
||||||
- FRAPPE_PY=erpnext-python
|
- FRAPPE_PY=erpnext-python
|
||||||
- FRAPPE_PY_PORT=8000
|
- FRAPPE_PY_PORT=8000
|
||||||
- FRAPPE_SOCKETIO=frappe-socketio
|
- FRAPPE_SOCKETIO=frappe-socketio
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,9 @@ These variables are set on every container start. Change in these variables will
|
||||||
- `FRAPPE_SOCKETIO`: SocketIO host to reverse proxy. Default: 0.0.0.0
|
- `FRAPPE_SOCKETIO`: SocketIO host to reverse proxy. Default: 0.0.0.0
|
||||||
- `SOCKETIO_PORT`: SocketIO port to reverse proxy. Default: 9000
|
- `SOCKETIO_PORT`: SocketIO port to reverse proxy. Default: 9000
|
||||||
- `HTTP_TIMEOUT`: Nginx http timeout. Default: 120
|
- `HTTP_TIMEOUT`: Nginx http timeout. Default: 120
|
||||||
|
- `UPSTREAM_REAL_IP_ADDRESS `: The trusted address (or ip range) of upstream proxy servers. If set, this will tell nginx to trust the X-Forwarded-For header from these proxy servers in determining the real IP address of connecting clients. Default: 127.0.0.1
|
||||||
|
- `UPSTREAM_REAL_IP_RECURSIVE`: When set to `on`, this will tell nginx to not just look to the last upstream proxy server in determining the real IP address. Default: off
|
||||||
|
- `UPSTREAM_REAL_IP_HEADER`: Set this to the header name sent by your upstream proxy server to indicate the real IP of connecting clients. Default: X-Forwarded-For
|
||||||
|
|
||||||
### frappe-socketio
|
### frappe-socketio
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -244,7 +244,4 @@ check_env
|
||||||
|
|
||||||
prompt_config
|
prompt_config
|
||||||
setup_user
|
setup_user
|
||||||
|
install
|
||||||
su - "$username" << EOF
|
|
||||||
install
|
|
||||||
EOF
|
|
||||||
|
|
@ -43,6 +43,7 @@ services:
|
||||||
- SOCKETIO_PORT=9000
|
- SOCKETIO_PORT=9000
|
||||||
volumes:
|
volumes:
|
||||||
- sites-vol:/home/frappe/frappe-bench/sites:rw
|
- sites-vol:/home/frappe/frappe-bench/sites:rw
|
||||||
|
- logs-vol:/home/frappe/frappe-bench/logs:rw
|
||||||
- assets-vol:/home/frappe/frappe-bench/sites/assets:rw
|
- assets-vol:/home/frappe/frappe-bench/sites/assets:rw
|
||||||
|
|
||||||
frappe-socketio:
|
frappe-socketio:
|
||||||
|
|
@ -54,6 +55,7 @@ services:
|
||||||
- redis-socketio
|
- redis-socketio
|
||||||
volumes:
|
volumes:
|
||||||
- sites-vol:/home/frappe/frappe-bench/sites:rw
|
- sites-vol:/home/frappe/frappe-bench/sites:rw
|
||||||
|
- logs-vol:/home/frappe/frappe-bench/logs:rw
|
||||||
|
|
||||||
frappe-worker-default:
|
frappe-worker-default:
|
||||||
image: [app]-worker
|
image: [app]-worker
|
||||||
|
|
@ -67,6 +69,7 @@ services:
|
||||||
- redis-cache
|
- redis-cache
|
||||||
volumes:
|
volumes:
|
||||||
- sites-vol:/home/frappe/frappe-bench/sites:rw
|
- sites-vol:/home/frappe/frappe-bench/sites:rw
|
||||||
|
- logs-vol:/home/frappe/frappe-bench/logs:rw
|
||||||
|
|
||||||
frappe-worker-short:
|
frappe-worker-short:
|
||||||
image: [app]-worker
|
image: [app]-worker
|
||||||
|
|
@ -82,6 +85,7 @@ services:
|
||||||
- redis-cache
|
- redis-cache
|
||||||
volumes:
|
volumes:
|
||||||
- sites-vol:/home/frappe/frappe-bench/sites:rw
|
- sites-vol:/home/frappe/frappe-bench/sites:rw
|
||||||
|
- logs-vol:/home/frappe/frappe-bench/logs:rw
|
||||||
|
|
||||||
frappe-worker-long:
|
frappe-worker-long:
|
||||||
image: [app]-worker
|
image: [app]-worker
|
||||||
|
|
@ -97,6 +101,7 @@ services:
|
||||||
- redis-cache
|
- redis-cache
|
||||||
volumes:
|
volumes:
|
||||||
- sites-vol:/home/frappe/frappe-bench/sites:rw
|
- sites-vol:/home/frappe/frappe-bench/sites:rw
|
||||||
|
- logs-vol:/home/frappe/frappe-bench/logs:rw
|
||||||
|
|
||||||
frappe-schedule:
|
frappe-schedule:
|
||||||
image: [app]-worker
|
image: [app]-worker
|
||||||
|
|
@ -110,7 +115,9 @@ services:
|
||||||
- redis-cache
|
- redis-cache
|
||||||
volumes:
|
volumes:
|
||||||
- sites-vol:/home/frappe/frappe-bench/sites:rw
|
- sites-vol:/home/frappe/frappe-bench/sites:rw
|
||||||
|
- logs-vol:/home/frappe/frappe-bench/logs:rw
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
assets-vol:
|
assets-vol:
|
||||||
sites-vol:
|
sites-vol:
|
||||||
|
logs-vol:
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,7 @@ services:
|
||||||
volumes:
|
volumes:
|
||||||
- sites-vol:/home/frappe/frappe-bench/sites:rw
|
- sites-vol:/home/frappe/frappe-bench/sites:rw
|
||||||
- assets-vol:/home/frappe/frappe-bench/sites/assets:rw
|
- assets-vol:/home/frappe/frappe-bench/sites/assets:rw
|
||||||
|
- logs-vol:/home/frappe/frappe-bench/logs:rw
|
||||||
|
|
||||||
frappe-socketio:
|
frappe-socketio:
|
||||||
image: frappe/frappe-socketio:${FRAPPE_VERSION}
|
image: frappe/frappe-socketio:${FRAPPE_VERSION}
|
||||||
|
|
@ -51,6 +52,7 @@ services:
|
||||||
- redis-socketio
|
- redis-socketio
|
||||||
volumes:
|
volumes:
|
||||||
- sites-vol:/home/frappe/frappe-bench/sites:rw
|
- sites-vol:/home/frappe/frappe-bench/sites:rw
|
||||||
|
- logs-vol:/home/frappe/frappe-bench/logs:rw
|
||||||
|
|
||||||
frappe-worker-default:
|
frappe-worker-default:
|
||||||
image: frappe/erpnext-worker:${ERPNEXT_VERSION}
|
image: frappe/erpnext-worker:${ERPNEXT_VERSION}
|
||||||
|
|
@ -64,6 +66,7 @@ services:
|
||||||
- redis-cache
|
- redis-cache
|
||||||
volumes:
|
volumes:
|
||||||
- sites-vol:/home/frappe/frappe-bench/sites:rw
|
- sites-vol:/home/frappe/frappe-bench/sites:rw
|
||||||
|
- logs-vol:/home/frappe/frappe-bench/logs:rw
|
||||||
|
|
||||||
frappe-worker-short:
|
frappe-worker-short:
|
||||||
image: frappe/erpnext-worker:${ERPNEXT_VERSION}
|
image: frappe/erpnext-worker:${ERPNEXT_VERSION}
|
||||||
|
|
@ -79,6 +82,7 @@ services:
|
||||||
- redis-cache
|
- redis-cache
|
||||||
volumes:
|
volumes:
|
||||||
- sites-vol:/home/frappe/frappe-bench/sites:rw
|
- sites-vol:/home/frappe/frappe-bench/sites:rw
|
||||||
|
- logs-vol:/home/frappe/frappe-bench/logs:rw
|
||||||
|
|
||||||
frappe-worker-long:
|
frappe-worker-long:
|
||||||
image: frappe/erpnext-worker:${ERPNEXT_VERSION}
|
image: frappe/erpnext-worker:${ERPNEXT_VERSION}
|
||||||
|
|
@ -94,6 +98,7 @@ services:
|
||||||
- redis-cache
|
- redis-cache
|
||||||
volumes:
|
volumes:
|
||||||
- sites-vol:/home/frappe/frappe-bench/sites:rw
|
- sites-vol:/home/frappe/frappe-bench/sites:rw
|
||||||
|
- logs-vol:/home/frappe/frappe-bench/logs:rw
|
||||||
|
|
||||||
frappe-schedule:
|
frappe-schedule:
|
||||||
image: frappe/erpnext-worker:${ERPNEXT_VERSION}
|
image: frappe/erpnext-worker:${ERPNEXT_VERSION}
|
||||||
|
|
@ -107,7 +112,9 @@ services:
|
||||||
- redis-cache
|
- redis-cache
|
||||||
volumes:
|
volumes:
|
||||||
- sites-vol:/home/frappe/frappe-bench/sites:rw
|
- sites-vol:/home/frappe/frappe-bench/sites:rw
|
||||||
|
- logs-vol:/home/frappe/frappe-bench/logs:rw
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
assets-vol:
|
assets-vol:
|
||||||
sites-vol:
|
sites-vol:
|
||||||
|
logs-vol:
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,7 @@ services:
|
||||||
- AUTO_MIGRATE=1
|
- AUTO_MIGRATE=1
|
||||||
volumes:
|
volumes:
|
||||||
- sites-vol:/home/frappe/frappe-bench/sites:rw
|
- sites-vol:/home/frappe/frappe-bench/sites:rw
|
||||||
|
- logs-vol:/home/frappe/frappe-bench/logs:rw
|
||||||
- assets-vol:/home/frappe/frappe-bench/sites/assets:rw
|
- assets-vol:/home/frappe/frappe-bench/sites/assets:rw
|
||||||
|
|
||||||
frappe-socketio:
|
frappe-socketio:
|
||||||
|
|
@ -51,6 +52,7 @@ services:
|
||||||
- redis-socketio
|
- redis-socketio
|
||||||
volumes:
|
volumes:
|
||||||
- sites-vol:/home/frappe/frappe-bench/sites:rw
|
- sites-vol:/home/frappe/frappe-bench/sites:rw
|
||||||
|
- logs-vol:/home/frappe/frappe-bench/logs:rw
|
||||||
|
|
||||||
frappe-worker-default:
|
frappe-worker-default:
|
||||||
image: frappe/frappe-worker:${FRAPPE_VERSION}
|
image: frappe/frappe-worker:${FRAPPE_VERSION}
|
||||||
|
|
@ -64,6 +66,7 @@ services:
|
||||||
- redis-cache
|
- redis-cache
|
||||||
volumes:
|
volumes:
|
||||||
- sites-vol:/home/frappe/frappe-bench/sites:rw
|
- sites-vol:/home/frappe/frappe-bench/sites:rw
|
||||||
|
- logs-vol:/home/frappe/frappe-bench/logs:rw
|
||||||
|
|
||||||
frappe-worker-short:
|
frappe-worker-short:
|
||||||
image: frappe/frappe-worker:${FRAPPE_VERSION}
|
image: frappe/frappe-worker:${FRAPPE_VERSION}
|
||||||
|
|
@ -79,6 +82,7 @@ services:
|
||||||
- redis-cache
|
- redis-cache
|
||||||
volumes:
|
volumes:
|
||||||
- sites-vol:/home/frappe/frappe-bench/sites:rw
|
- sites-vol:/home/frappe/frappe-bench/sites:rw
|
||||||
|
- logs-vol:/home/frappe/frappe-bench/logs:rw
|
||||||
|
|
||||||
frappe-worker-long:
|
frappe-worker-long:
|
||||||
image: frappe/frappe-worker:${FRAPPE_VERSION}
|
image: frappe/frappe-worker:${FRAPPE_VERSION}
|
||||||
|
|
@ -94,6 +98,7 @@ services:
|
||||||
- redis-cache
|
- redis-cache
|
||||||
volumes:
|
volumes:
|
||||||
- sites-vol:/home/frappe/frappe-bench/sites:rw
|
- sites-vol:/home/frappe/frappe-bench/sites:rw
|
||||||
|
- logs-vol:/home/frappe/frappe-bench/logs:rw
|
||||||
|
|
||||||
frappe-schedule:
|
frappe-schedule:
|
||||||
image: frappe/frappe-worker:${FRAPPE_VERSION}
|
image: frappe/frappe-worker:${FRAPPE_VERSION}
|
||||||
|
|
@ -107,7 +112,9 @@ services:
|
||||||
- redis-cache
|
- redis-cache
|
||||||
volumes:
|
volumes:
|
||||||
- sites-vol:/home/frappe/frappe-bench/sites:rw
|
- sites-vol:/home/frappe/frappe-bench/sites:rw
|
||||||
|
- logs-vol:/home/frappe/frappe-bench/logs:rw
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
assets-vol:
|
assets-vol:
|
||||||
sites-vol:
|
sites-vol:
|
||||||
|
logs-vol:
|
||||||
Loading…
Reference in a new issue