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

Merge pull request #292 from revant/fix-bench-image

fix: bench image
This commit is contained in:
Revant Nandgaonkar 2020-07-01 04:28:48 +05:30 committed by GitHub
commit cf0dd228ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 64 additions and 37 deletions

View File

@ -85,8 +85,8 @@ RUN bash -c "bench --version"
# https://nodejs.org/download/release/latest-v10.x/ # https://nodejs.org/download/release/latest-v10.x/
# https://nodejs.org/download/release/latest-v12.x/ # https://nodejs.org/download/release/latest-v12.x/
# https://nodejs.org/download/release/latest-v13.x/ # https://nodejs.org/download/release/latest-v13.x/
ENV NODE_VERSION=12 ENV NODE_VERSION=12.18.2
ENV NODE_VERSION_FRAPPEV11=10 ENV NODE_VERSION_FRAPPEV11=10.21.0
# Install nvm with node # Install nvm with node
RUN wget https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh RUN wget https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh
@ -103,9 +103,6 @@ RUN . "$NVM_DIR/nvm.sh" && nvm use v${NODE_VERSION} && npm install -g yarn
RUN . "$NVM_DIR/nvm.sh" && nvm alias default v${NODE_VERSION} RUN . "$NVM_DIR/nvm.sh" && nvm alias default v${NODE_VERSION}
ENV PATH="/home/frappe/.nvm/versions/node/v${NODE_VERSION}/bin/:${PATH}" ENV PATH="/home/frappe/.nvm/versions/node/v${NODE_VERSION}/bin/:${PATH}"
# Install yarn
RUN npm install -g yarn
# Print version and verify bashrc is properly sourced so that everything works in the Dockerfile # Print version and verify bashrc is properly sourced so that everything works in the Dockerfile
RUN node --version \ RUN node --version \
&& npm --version \ && npm --version \

View File

@ -3,16 +3,21 @@ version: "3"
services: services:
traefik: traefik:
image: "traefik:v2.2" image: "traefik:v2.2"
command:
- "--log.level=DEBUG"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
labels:
# enable traefik
- "traefik.enable=true"
ports: ports:
- "80:80" - "80:80"
deploy:
restart_policy:
condition: on-failure
labels:
- "traefik.enable=true"
command:
- "--log.level=DEBUG"
- "--providers.docker"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
- "--providers.docker.swarmmode"
- "--accesslog"
- "--log"
volumes: volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro - /var/run/docker.sock:/var/run/docker.sock:ro
@ -24,20 +29,25 @@ services:
- FRAPPE_PY_PORT=8000 - FRAPPE_PY_PORT=8000
- FRAPPE_SOCKETIO=frappe-socketio - FRAPPE_SOCKETIO=frappe-socketio
- SOCKETIO_PORT=9000 - SOCKETIO_PORT=9000
labels: deploy:
- "traefik.enable=true" restart_policy:
- "traefik.http.routers.erpnext-nginx.rule=HostRegexp(`{catchall:.*}`)" condition: on-failure
- "traefik.http.middlewares.erpnext-nginx.headers.customrequestheaders.Host=mysite.localhost" labels:
- "traefik.http.routers.erpnext-nginx.middlewares=erpnext-nginx" - "traefik.enable=true"
- "traefik.http.routers.erpnext-nginx.entrypoints=web" - "traefik.http.routers.erpnext-nginx.rule=HostRegexp(`{catchall:.*}`)"
- "traefik.http.services.erpnext-nginx.loadbalancer.server.port=80" - "traefik.http.middlewares.erpnext-nginx.headers.customrequestheaders.Host=mysite.localhost"
- "traefik.http.routers.erpnext-nginx.middlewares=erpnext-nginx"
- "traefik.http.routers.erpnext-nginx.entrypoints=web"
- "traefik.http.services.erpnext-nginx.loadbalancer.server.port=80"
volumes: volumes:
- sites-vol:/var/www/html/sites:rw - sites-vol:/var/www/html/sites:rw
- assets-vol:/assets:rw - assets-vol:/assets:rw
erpnext-python: erpnext-python:
image: frappe/erpnext-worker:edge image: frappe/erpnext-worker:edge
restart: on-failure deploy:
restart_policy:
condition: on-failure
environment: environment:
- MARIADB_HOST=mariadb - MARIADB_HOST=mariadb
- REDIS_CACHE=redis-cache:6379 - REDIS_CACHE=redis-cache:6379
@ -51,15 +61,17 @@ services:
frappe-socketio: frappe-socketio:
image: frappe/frappe-socketio:edge image: frappe/frappe-socketio:edge
restart: on-failure deploy:
depends_on: restart_policy:
- redis-socketio condition: on-failure
volumes: volumes:
- sites-vol:/home/frappe/frappe-bench/sites:rw - sites-vol:/home/frappe/frappe-bench/sites:rw
erpnext-worker-default: erpnext-worker-default:
image: frappe/erpnext-worker:edge image: frappe/erpnext-worker:edge
restart: on-failure deploy:
restart_policy:
condition: on-failure
command: worker command: worker
depends_on: depends_on:
- redis-queue - redis-queue
@ -69,7 +81,9 @@ services:
erpnext-worker-short: erpnext-worker-short:
image: frappe/erpnext-worker:edge image: frappe/erpnext-worker:edge
restart: on-failure deploy:
restart_policy:
condition: on-failure
command: worker command: worker
environment: environment:
- WORKER_TYPE=short - WORKER_TYPE=short
@ -81,7 +95,9 @@ services:
erpnext-worker-long: erpnext-worker-long:
image: frappe/erpnext-worker:edge image: frappe/erpnext-worker:edge
restart: on-failure deploy:
restart_policy:
condition: on-failure
command: worker command: worker
environment: environment:
- WORKER_TYPE=long - WORKER_TYPE=long
@ -93,7 +109,9 @@ services:
erpnext-schedule: erpnext-schedule:
image: frappe/erpnext-worker:edge image: frappe/erpnext-worker:edge
restart: on-failure deploy:
restart_policy:
condition: on-failure
command: schedule command: schedule
depends_on: depends_on:
- redis-queue - redis-queue
@ -103,30 +121,42 @@ services:
redis-cache: redis-cache:
image: redis:latest image: redis:latest
restart: on-failure deploy:
restart_policy:
condition: on-failure
volumes: volumes:
- redis-cache-vol:/data - redis-cache-vol:/data
redis-queue: redis-queue:
image: redis:latest image: redis:latest
restart: on-failure deploy:
restart_policy:
condition: on-failure
volumes: volumes:
- redis-queue-vol:/data - redis-queue-vol:/data
redis-socketio: redis-socketio:
image: redis:latest image: redis:latest
restart: on-failure deploy:
restart_policy:
condition: on-failure
volumes: volumes:
- redis-socketio-vol:/data - redis-socketio-vol:/data
site-configurator: site-configurator:
image: frappe/erpnext-worker:edge image: frappe/erpnext-worker:edge
deploy:
restart_policy:
condition: none
command: ["bash", "-c", "echo mysite.localhost > /sites/currentsite.txt"] command: ["bash", "-c", "echo mysite.localhost > /sites/currentsite.txt"]
volumes: volumes:
- sites-vol:/sites:rw - sites-vol:/sites:rw
mariadb-configurator: mariadb-configurator:
image: mariadb:10.3 image: mariadb:10.3
deploy:
restart_policy:
condition: none
command: command:
- "bash" - "bash"
- "-c" - "-c"
@ -147,9 +177,9 @@ services:
mariadb: mariadb:
image: mariadb:10.3 image: mariadb:10.3
restart: on-failure deploy:
depends_on: restart_policy:
- mariadb-configurator condition: on-failure
environment: environment:
- MYSQL_ROOT_PASSWORD=admin - MYSQL_ROOT_PASSWORD=admin
volumes: volumes:
@ -158,10 +188,10 @@ services:
site-creator: site-creator:
image: frappe/erpnext-worker:edge image: frappe/erpnext-worker:edge
restart: "no" deploy:
restart_policy:
condition: none
command: new command: new
depends_on:
- erpnext-python
environment: environment:
- SITE_NAME=mysite.localhost - SITE_NAME=mysite.localhost
- DB_ROOT_USER=root - DB_ROOT_USER=root