2
0
mirror of https://github.com/frappe/frappe_docker.git synced 2024-12-27 19:54:56 +00:00
Commit Graph

175 Commits

Author SHA1 Message Date
Revant Nandgaonkar
e8b9710052 fix: mysql error during set db password 2020-04-29 14:03:11 +05:30
Chinmay D. Pai
8f20e5e00d
chore: escape backticks on db commands
Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
2020-04-29 11:44:58 +05:30
Chinmay D. Pai
884a82d814
fix: make semantic changes to commands
* add missing __main__ call to commands.py
* remove unnecessary imports
* fix backup WITH_FILES logic
* follow python semantics (?)

Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
2020-04-29 01:45:59 +05:30
Revant Nandgaonkar
479ce83f5c fix: required region s3 compatible backup/restore 2020-04-26 22:48:35 +05:30
Revant Nandgaonkar
7599252a62 revert(frappe-nginx): revert v12.Dockerfile
standard_style.css generation not required for v12
2020-04-23 21:56:52 +05:30
Revant Nandgaonkar
4f411104f3 fix(frappe-nginx): Generate Standard Style CSS
use nunjucks to render jinja2 template
generate default theme
2020-04-23 14:56:46 +05:30
Revant Nandgaonkar
529c23866f fix(frappe-nginx): fix connection message 2020-04-21 14:59:06 +05:30
Davide Bortolami
87e0648c3d Merge commit '78b2db1af10c0f94a50395f06f6021934921fe17' into develop 2020-04-17 00:34:42 +01:00
Davide Bortolami
2e0a863ef7 Update documentation, add ssh-client to bench build, expose MariaDB port in development 2020-04-17 00:34:22 +01:00
girish pasupathy
7498d5439a Support for reading Mariadb and Admin password from file when using docker secrets
With this PR, password can be read from docker secrets in both compose as well as swarm environment.

```YAML

secrets:
  mariadb-root-password:
    file: mariadb-root-password.txt
  erpnext-admin-password:
    file: erpnext-admin-password.txt

services:
  erpnext:
    image: frappe/erpnext-worker:${ERPNEXT_VERSION:-v12.5.2}
    environment:
      - SITE_NAME=example.com
      - DB_ROOT_USER=root
      - MARIADB_HOST=mariadb
      - INSTALL_APPS=erpnext
      - FORCE=1
      - REDIS_CACHE=redis-cache:6379
      - REDIS_QUEUE=redis-queue:6379
      - REDIS_SOCKETIO=redis-socketio:6379
      - SOCKETIO_PORT=9000
      - AUTO_MIGRATE=1
      - ADMIN_PASSWORD_FILE=/run/secrets/erpnext-admin-password
      - MYSQL_ROOT_PASSWORD_FILE=/run/secrets/mariadb-root-password
    secrets:
      - erpnext-admin-password
      - mariadb-root-password
    restart: on-failure
    volumes:
      - erpnext-data:/home/frappe/frappe-bench/sites
      - assets-data:/home/frappe/frappe-bench/sites/assets
    links:
      - redis-cache
      - redis-queue
      - redis-socketio
      - mariadb
    depends_on:
      - mariadb
      - redis-cache
      - redis-queue
      - redis-socketio
    networks:
      - erpnext-net
```

Reference: [Addind docker secrets in to your images](https://docs.docker.com/engine/swarm/secrets/#build-support-for-docker-secrets-into-your-images)

Changes to be committed:
	modified:   ../../README.md
	modified:   ../common/commands/new.py
	modified:   ../common/commands/restore_backup.py
	modified:   ../erpnext-nginx/docker-entrypoint.sh
2020-04-16 11:49:40 +05:30
girish pasupathy
87c251a464 Changed X-Frappe-Site-Name header to use value from $host instead of $http_host in nginx configuration
ISSUE
-----
`$http_host` is used for setting header 'X-Frappe-Site-Name'
which adds port number to the header along with the host value. Frappe source app.py expects the header
value to contain only the host name and not the port number. So `$host` should be used instead of
`$http_host` to set the 'X-Frappe-Site-Name' header

`$http_host` vs `$host` in nginx
--------------------------------
`$http_host` contains the host name along with port number whereas `$host` contains only the host name in lowercase without the port number.

> `$host` - This variable is equal to line Host in the header of request or
> name of the server processing the request if the Host header is not available.
> This variable may have a different value from $http_host in such cases:
> * when the Host input header is absent or has an empty value,
> `$host` equals to the value of server_name directive;
> * when the value of Host contains port number, `$host` doesn't include
> that port number. $host's value is always lowercase since 0.8.17.
> - [$host vs $http_host stackoverflow](https://stackoverflow.com/questions/15414810/whats-the-difference-of-host-and-http-host-in-nginx)

From the frappe source file [app.py](https://github.com/frappe/frappe/blob/develop/frappe/app.py#L107), X-Frappe-Site-Name is used if its set.

```Python
site = _site or request.headers.get('X-Frappe-Site-Name') or get_site_name(request.host)
```

Since `$host` variable will never contain port number which is not the case with `$http_host`,
`$host` should be used for setting the header 'X-Frappe-Site-Name'. Otherwise we have issues with site serving.

Tested the above changes in compose as well as in swarm environment.
In compose, tested the site with host mapping of 80 and 8000. Works with both the host port mapping.

Tested with erpnext version - v12.5.2

Changes to be committed:
	modified:   build/common/nginx-default.conf.template
2020-04-09 18:58:34 +05:30
Revant Nandgaonkar
2422fbad26 fix: backup and restore
create backup dir in worker images
set ownership and mount volume for backups
update readme about restore backup
2020-03-27 16:41:32 +05:30
Revant Nandgaonkar
4e7b7690ee fix: backup and restore
new command FORCE=1 error fixed
only push backups if exists
prepare and process db restore
2020-03-27 16:07:12 +05:30
Revant Nandgaonkar
3a6f7e1934 feat: resotre backups from volume or cloud 2020-03-27 00:28:50 +05:30
Revant Nandgaonkar
754ba8a91a feat: restrict backups to backup limit for each site 2020-03-25 22:25:24 +05:30
Revant Nandgaonkar
5f187c4e3f feat: worker command to push backups to cloud 2020-03-25 06:35:49 +05:30
Revant Nandgaonkar
14dc20d510 fix: do not auto migrate on first run 2020-03-22 19:08:41 +05:30
Revant Nandgaonkar
674c766480 feat: auto migrate on container start if AUTO_MIGRATE set 2020-03-21 15:47:35 +05:30
Revant Nandgaonkar
7c356ccb27 fix: make python commands modular and reusable 2020-03-20 20:56:23 +05:30
Revant Nandgaonkar
f1393c3a94 fix(frappe-nginx): fix missing /rsync
fixes #160
2020-03-20 05:21:30 +05:30
Revant Nandgaonkar
8475af3785 fix(frappe-worker): set sites volume ownership 2020-03-17 22:31:37 +05:30
Revant Nandgaonkar
1db512d334 fix: travis wrapper script for build on master
third attempt to get builds on master running
2020-03-17 00:14:16 +05:30
Revant Nandgaonkar
6e8d2bf7c2 fix: nginx config
add updates from frappe/bench to config
2020-03-15 00:20:28 +05:30
Revant Nandgaonkar
40ceb79023 fix: python container healthcheck
ping all backing services
2020-03-14 22:47:35 +05:30
Revant Nandgaonkar
56124984d7 fix(bench): debugger fail after bench update
fix debugger fail after bench update
error locale.Error: unsupported locale setting
add locale to image
2020-03-12 05:53:47 +05:30
Revant Nandgaonkar
f506c25a6e feat(bench): bash-completion
add bash-completion package
remove install_packages duplicates
workdir set to /home/frappe
2020-03-11 22:38:48 +05:30
Revant Nandgaonkar
ae8d880702
Merge pull request #135 from fermiumlabs/update-debian
Update debian
2020-03-10 06:07:15 +05:30
Davide Bortolami
ba239c0ebe Install yarn in both nodes 2020-03-10 00:08:50 +00:00
Davide Bortolami
31f770d467 UID GID 1000 2020-03-10 00:00:46 +00:00
Davide Bortolami
1e9cdacf1a Reduce layers 2020-03-09 23:37:25 +00:00
Davide Bortolami
104f3e67e2 reduce layers 2020-03-09 13:39:28 +00:00
Davide Bortolami
b36513f8fd fix image build fail 2020-03-09 13:29:58 +00:00
Davide Bortolami
07a43e5386 removed not needed volume 2020-03-09 13:26:42 +00:00
Davide Bortolami
8611c2dc05 reduce layers, cleanup comments 2020-03-08 23:37:30 +00:00
Davide Bortolami
0746693c1f some other useful software 2020-03-08 19:07:03 +00:00
Davide Bortolami
ae5979ee8f Fixed node and python installation, local user 2020-03-08 18:37:26 +00:00
Davide Bortolami
d46c97f64a Enumerate node packages 2020-03-08 16:24:07 +00:00
Davide Bortolami
333786d013 small cleanup 2020-03-07 18:43:58 +00:00
Davide Bortolami
b437dcd284 Update development Dockerfile to better resemble production dockerfiles. Still untested. 2020-03-07 18:24:54 +00:00
Revant Nandgaonkar
07806f1086 fix: worker new-site command
fixes #128
2020-03-07 19:39:59 +05:30
Revant Nandgaonkar
0f03713e5c fix: erpnext nginx image install_app script 2020-03-07 16:45:53 +05:30
Revant Nandgaonkar
e5a5a05dfb fix: erpnext nginx image build 2020-03-07 15:47:50 +05:30
Davide Bortolami
94e62d0268 fix #119 2020-03-07 00:38:10 +00:00
Revant Nandgaonkar
d00770e42f fix: install_app set branch 2020-03-07 05:33:32 +05:30
chabad360
b6eb3ccde2 bug fix in install_apps.sh 2020-03-06 06:29:12 +00:00
chabad360
7bdd329793 some small changes 2020-03-06 06:23:53 +00:00
chabad360
1c513f9e41 Merge remote-tracking branch 'upstream/develop' into install_app 2020-03-06 06:21:07 +00:00
Revant Nandgaonkar
be3d90dd03 fix: bench image
install nvm in user home
allows npm install -g
install yarn in v10
2020-03-05 23:49:48 +05:30
Revant Nandgaonkar
d071bf232d feat: development docker 2020-03-05 21:56:31 +05:30
Revant Nandgaonkar
6782decfc6 fix: resolve travis yml conflicts
use travis.py
2020-03-05 12:05:32 +05:30
chabad360
b254e018e5 shave off a layer 2020-03-05 02:28:42 +00:00
chabad360
d6e012e9c0 resolve merge conflicts 2020-03-05 01:43:50 +00:00
chabad360
959ab4fc7d one small change to support multi-tenancy 2020-03-05 01:38:01 +00:00
Revant Nandgaonkar
1843e8a642
Merge pull request #108 from fermiumlabs/fix-#101
Fixes #101
2020-03-05 06:45:11 +05:30
Davide Bortolami
922877bf92 Fixes #101
Nginx will now wait up to 10 seconds for frappe-python and frappe-socketio to be available
2020-03-04 14:15:25 +00:00
Revant Nandgaonkar
501d144728 fix: worker images new site command
install apps is a list not boolean
2020-03-04 14:36:13 +05:30
chabad360
48a305bec6 Adding in the rsync for the docker-entrypoint 2020-03-04 03:43:49 +00:00
chabad360
f4e24e15a8 create install_app for assets 2020-03-04 03:33:38 +00:00
chabad360
b610caba7e forgot about branches 2020-03-04 03:33:23 +00:00
chabad360
177ca58af6 add and implement install_app for worker image 2020-03-04 02:52:36 +00:00
Davide Bortolami
6f7a9b92ac Refactor renaming erpnext-assets and frappe-assets to erpnext-nginx and frappe-nginx 2020-03-03 23:40:11 +00:00
Revant Nandgaonkar
66343400ff fix: erpnext-assets v12 build 2020-03-02 22:58:52 +05:30
Revant Nandgaonkar
07bcaec723 fix: allow user process to create logs
allow user process to create logs in worker images
2020-03-02 16:01:35 +05:30
Revant Nandgaonkar
0df0d6d11f fix: use SOCKETIO_PORT instead of FRAPPE_SOCKETIO_PORT 2020-03-02 05:09:57 +05:30
Revant Nandgaonkar
c2c09400da fix: use commonly known variable for MYSQL_ROOT_PASSWORD 2020-03-02 05:08:49 +05:30
Revant Nandgaonkar
33b5071aaa fix: Frappe/ERPNext worker image new site command 2020-03-01 16:45:34 +05:30
Revant Nandgaonkar
e32d3b4e51 fix: ERPNext assets image build 2020-03-01 15:38:05 +05:30
Revant Nandgaonkar
9b6a641f4d fix: config generation
fix envsubst single quote SHELL-FORMAT
env var changed from ERPNEXT_PY to FRAPPE_PY
2020-02-20 21:48:51 +05:30
Revant Nandgaonkar
242708df0c refactor: reuse common scripts and files
move common scripts to build/common
2020-02-20 18:01:23 +05:30
Chinmay D. Pai
347b94dee2
chore: fixes to shell scripts
* envsubst: expression may fail to expand in single quotes
* use (()) instead of let
* use find instead of ls to better hand alphanumeric folders

Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
2020-02-20 12:33:52 +05:30
Chinmay D. Pai
3b5f829248
chore: remove unused update.py
Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
2020-02-20 12:09:51 +05:30
Chinmay D. Pai
0910278efd
feat: add support to start bench console
Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
2020-02-20 12:08:51 +05:30
Chinmay D. Pai
6677885e78
chore: reorder commands for clarity
Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
2020-02-20 11:44:51 +05:30
Revant Nandgaonkar
e1e1c6b6f9 refactor: rename images
erpnext-assets - ERPNext nginx config + static assets
erpnext-worker - ERPNext python environment
frappe-assets - Frappe nginx config + static assets
frappe-worker - Frappe python environment
frappe-socketio - Frappe socketio process common for apps
2020-02-17 20:35:54 +05:30
Revant Nandgaonkar
aeadd23214 feat: docker production images 2020-02-10 15:59:11 +05:30