106 Commits

Author SHA1 Message Date
Sajith K
6bc8b4041b Compat 2022 (#1174)
* Update nginx-template.conf

Update to allow access of private files

* updated node and python versions

* Update frontend.Dockerfile

updated bench build command to remove --production tag for version-13 frappe
2023-07-10 09:24:14 +05:30
Sajith K
3c77d58e59 Compat 2022 (#1170)
* Update nginx-template.conf

Update to allow access of private files

* updated node and python versions
2023-07-06 18:06:32 +05:30
Sajith K
aab7c0cee6 Update nginx-template.conf (#1091)
Update to allow access of private files
2023-03-06 17:05:52 +05:30
github-actions
f8e43a3114 chore: Update example.env 2023-01-10 18:00:47 +00:00
github-actions
36f8e63c18 chore: Update example.env 2023-01-10 13:44:08 +00:00
github-actions
5799f87277 chore: Update example.env 2023-01-04 06:26:25 +00:00
github-actions
9859178907 chore: Update example.env 2023-01-04 03:07:01 +00:00
github-actions
cadaa0a0bf chore: Update example.env 2022-12-27 12:53:43 +00:00
github-actions
11fb3fdf60 chore: Update example.env 2022-12-27 10:08:33 +00:00
Bernhard Sirlinger
8f7b234a12 feat: make client_max_body_size configurable via env (#1029) 2022-12-27 03:12:22 +05:30
Bernhard Sirlinger
75e44ba902 feat: make proxy read timeout configurable via env (#975) 2022-12-25 13:23:55 +05:30
github-actions[bot]
e9a2512ba2 chore(deps): Update pre-commit hooks (#1027)
Co-authored-by: vrslev <vrslev@users.noreply.github.com>
2022-12-22 19:18:40 +05:30
dependabot[bot]
a5667b0774 chore(deps): bump nginxinc/nginx-unprivileged in /images/nginx (#1026)
Bumps nginxinc/nginx-unprivileged from 1.23.2-alpine to 1.23.3-alpine.

---
updated-dependencies:
- dependency-name: nginxinc/nginx-unprivileged
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-21 19:58:16 +05:30
dependabot[bot]
ab59b25e12 chore(deps): bump actions/stale from 6 to 7 (#1025)
Bumps [actions/stale](https://github.com/actions/stale) from 6 to 7.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/stale/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-21 19:57:38 +05:30
github-actions
0f452571af chore: Update example.env 2022-12-20 14:17:22 +00:00
github-actions
fb39fd6415 chore: Update example.env 2022-12-20 10:46:23 +00:00
Revant Nandgaonkar
e721081f16 fix: mount assets on workers (#1022) 2022-12-20 15:26:28 +05:30
Siraj Samsudeen
b0cc2bffc7 updated link to Docker Manual with screenshots (#1013)
* updated link to Docker Manual with screenshots

* added 2 images to docs/images and linked them
2022-12-20 10:46:50 +05:30
github-actions[bot]
d85f54cd7b chore(deps): Update pre-commit hooks (#1023)
Co-authored-by: vrslev <vrslev@users.noreply.github.com>
2022-12-18 21:36:47 +05:30
github-actions[bot]
41dd3149ff chore(deps): Update pre-commit hooks (#1021)
Co-authored-by: vrslev <vrslev@users.noreply.github.com>
2022-12-17 18:12:33 +05:30
github-actions[bot]
a8adae2c84 chore(deps): Update pre-commit hooks (#1019)
Co-authored-by: vrslev <vrslev@users.noreply.github.com>
2022-12-14 13:17:17 +05:30
github-actions
d15867fea3 chore: Update example.env 2022-12-13 12:35:58 +00:00
github-actions[bot]
01fdbfb226 chore(deps): Update pre-commit hooks (#1017)
Co-authored-by: vrslev <vrslev@users.noreply.github.com>
2022-12-13 17:40:39 +05:30
github-actions
70c815b958 chore: Update example.env 2022-12-13 10:35:47 +00:00
dependabot[bot]
f48abb6244 chore(deps-dev): bump black from 22.10.0 to 22.12.0 (#1016)
Bumps [black](https://github.com/psf/black) from 22.10.0 to 22.12.0.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](https://github.com/psf/black/compare/22.10.0...22.12.0)

---
updated-dependencies:
- dependency-name: black
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-12 17:31:22 +05:30
github-actions[bot]
45c6401da9 chore(deps): Update pre-commit hooks (#1015)
Co-authored-by: vrslev <vrslev@users.noreply.github.com>
2022-12-10 13:52:56 +05:30
Revant Nandgaonkar
009877d67c fix: create config directory in worker image (#1014)
* fix: add git to worker image

* fix: create config directory in worker image
2022-12-10 13:52:37 +05:30
github-actions
19c5e5099c chore: Update example.env 2022-12-08 15:50:14 +00:00
github-actions[bot]
c6aa9e21c8 chore(deps): Update pre-commit hooks (#1011)
Co-authored-by: vrslev <vrslev@users.noreply.github.com>
2022-12-08 18:43:57 +05:30
github-actions
d9fa219bb1 chore: Update example.env 2022-12-06 14:54:23 +00:00
github-actions
c35613d64b chore: Update example.env 2022-12-06 10:25:22 +00:00
github-actions[bot]
17197aca2c chore(deps): Update pre-commit hooks (#1007)
Co-authored-by: vrslev <vrslev@users.noreply.github.com>
2022-12-04 04:17:42 +05:30
github-actions
51024d819d chore: Update example.env 2022-11-30 15:34:51 +00:00
github-actions[bot]
24b96ff6af chore(deps): Update pre-commit hooks (#1005)
Co-authored-by: vrslev <vrslev@users.noreply.github.com>
2022-11-30 14:06:55 +05:30
github-actions
f683edc205 chore: Update example.env 2022-11-29 13:31:32 +00:00
github-actions
915fb780b6 chore: Update example.env 2022-11-29 10:43:51 +00:00
github-actions[bot]
41cba18a1a chore(deps): Update pre-commit hooks (#1003)
Co-authored-by: vrslev <vrslev@users.noreply.github.com>
2022-11-24 14:08:39 +05:30
github-actions
77eac51125 chore: Update example.env 2022-11-22 16:14:45 +00:00
github-actions
933fc37209 chore: Update example.env 2022-11-22 13:24:14 +00:00
github-actions
e858078d30 chore: Update example.env 2022-11-15 13:15:51 +00:00
github-actions
b2f6bf1a48 chore: Update example.env 2022-11-15 11:07:31 +00:00
github-actions[bot]
7b5eac5d53 chore(deps): Update pre-commit hooks (#1001)
Co-authored-by: vrslev <vrslev@users.noreply.github.com>
2022-11-11 15:57:07 +05:30
github-actions[bot]
ac039770dc chore(deps): Update pre-commit hooks (#1000)
Co-authored-by: vrslev <vrslev@users.noreply.github.com>
2022-11-10 13:14:08 +05:30
github-actions
1d707e86be chore: Update example.env 2022-11-08 12:27:55 +00:00
github-actions
bf1f8b4c16 chore: Update example.env 2022-11-08 10:39:19 +00:00
Revant Nandgaonkar
63902fd427 fix(frappe-socketio): use package.json from frappe repo (#996)
fixes #994
2022-11-05 14:43:33 +05:30
github-actions
3661059667 chore: Update example.env 2022-11-04 15:58:35 +00:00
Smit Vora
e468921b5e fix: incorrect eval for bool in bash (#995) 2022-11-04 17:12:13 +05:30
github-actions
6c1e8c2c08 chore: Update example.env 2022-11-03 08:17:35 +00:00
Smit Vora
01bd8f6bb2 feat: install client apps using script (#992)
* feat: install client apps using script

* chore: ignore shellcheck pre-commit
2022-11-03 12:59:11 +05:30
github-actions
2a334a2724 chore: Update example.env 2022-11-01 17:32:13 +00:00
github-actions
ba3cadbc4f chore: Update example.env 2022-11-01 13:54:43 +00:00
github-actions[bot]
20eab28bab chore(deps): Update pre-commit hooks (#986)
Co-authored-by: vrslev <vrslev@users.noreply.github.com>
2022-10-30 15:22:26 +05:30
Peter Dave Hello
bfd847eaca Prevent leaving pip install cache in Docker image (#985) 2022-10-28 18:45:44 +05:30
github-actions[bot]
d022634811 chore(deps): Update pre-commit hooks (#984)
Co-authored-by: vrslev <vrslev@users.noreply.github.com>
2022-10-28 18:41:42 +05:30
github-actions
a42e97579f chore: Update example.env 2022-10-26 05:21:32 +00:00
github-actions
8b01439daa chore: Update example.env 2022-10-25 12:36:12 +00:00
dependabot[bot]
64257ecaa6 chore(deps): bump pytest from 7.1.3 to 7.2.0 (#982)
Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.1.3 to 7.2.0.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/7.1.3...7.2.0)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-25 16:49:25 +05:30
Babuuu
83f7db0c50 Use docker --chown command instead of RUN chown (#979)
The `RUN chown -R frappe:frappe /home/frappe` command was taking too long for me, over 6 minutes before I gave up and killed it. docker chown is faster, and it helps avoid creating a new layer.
2022-10-24 17:52:22 +05:30
dependabot[bot]
35b944d850 chore(deps): bump nginxinc/nginx-unprivileged in /images/nginx (#978)
Bumps nginxinc/nginx-unprivileged from 1.23.1-alpine to 1.23.2-alpine.

---
updated-dependencies:
- dependency-name: nginxinc/nginx-unprivileged
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-21 21:49:32 +05:30
dependabot[bot]
37b59843f5 chore(deps): bump webfactory/ssh-agent from 0.6.0 to 0.7.0 (#977)
Bumps [webfactory/ssh-agent](https://github.com/webfactory/ssh-agent) from 0.6.0 to 0.7.0.
- [Release notes](https://github.com/webfactory/ssh-agent/releases)
- [Changelog](https://github.com/webfactory/ssh-agent/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webfactory/ssh-agent/compare/v0.6.0...v0.7.0)

---
updated-dependencies:
- dependency-name: webfactory/ssh-agent
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-21 21:49:07 +05:30
github-actions[bot]
ceae7e9ba0 chore(deps): Update pre-commit hooks (#976)
Co-authored-by: vrslev <vrslev@users.noreply.github.com>
2022-10-21 21:47:56 +05:30
dependabot[bot]
82cc15253a chore(deps): bump webfactory/ssh-agent from 0.5.4 to 0.6.0 (#971)
Bumps [webfactory/ssh-agent](https://github.com/webfactory/ssh-agent) from 0.5.4 to 0.6.0.
- [Release notes](https://github.com/webfactory/ssh-agent/releases)
- [Changelog](https://github.com/webfactory/ssh-agent/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webfactory/ssh-agent/compare/v0.5.4...v0.6.0)

---
updated-dependencies:
- dependency-name: webfactory/ssh-agent
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-19 14:23:26 +05:30
Revant Nandgaonkar
8e7f8b3b71 fix: install correct nodejs as per frappe version (#970)
fixes #967, #969
2022-10-19 14:22:07 +05:30
github-actions
fcb52d218f chore: Update example.env 2022-10-18 18:16:56 +00:00
github-actions
d0cd1f7afc chore: Update example.env 2022-10-18 11:49:15 +00:00
Imesha Sudasingha
36592fb3fd Update default NodeJS version in development/README.md (#968)
For the frappe version 14
2022-10-18 03:56:29 +05:30
Revant Nandgaonkar
ba68887e40 fix: install node and python envs for v13 (#963)
fixes #962
2022-10-16 13:38:16 +05:30
github-actions[bot]
6bfd1f926e chore(deps): Update pre-commit hooks (#960)
Co-authored-by: vrslev <vrslev@users.noreply.github.com>
2022-10-15 17:45:56 +05:30
github-actions
a7aae8a000 chore: Update example.env 2022-10-12 12:38:00 +00:00
dependabot[bot]
8c9322b3a3 chore(deps): bump docker/bake-action from 2.2.0 to 2.3.0 (#957)
Bumps [docker/bake-action](https://github.com/docker/bake-action) from 2.2.0 to 2.3.0.
- [Release notes](https://github.com/docker/bake-action/releases)
- [Commits](https://github.com/docker/bake-action/compare/v2.2.0...v2.3.0)

---
updated-dependencies:
- dependency-name: docker/bake-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-12 16:40:16 +05:30
github-actions[bot]
cfb2f40158 chore(deps): Update pre-commit hooks (#956)
Co-authored-by: vrslev <vrslev@users.noreply.github.com>
2022-10-12 05:09:36 +05:30
github-actions
41a155283e chore: Update example.env 2022-10-11 13:10:27 +00:00
github-actions
76de3b3ce8 chore: Update example.env 2022-10-11 10:39:28 +00:00
github-actions[bot]
1f78fe7204 chore(deps): Update pre-commit hooks (#955)
Co-authored-by: vrslev <vrslev@users.noreply.github.com>
2022-10-10 13:07:29 +05:30
github-actions
289c2b7bfb chore: Update example.env 2022-10-07 12:53:50 +00:00
dependabot[bot]
34a0cfb5b0 chore(deps-dev): bump black from 22.8.0 to 22.10.0 (#953)
Bumps [black](https://github.com/psf/black) from 22.8.0 to 22.10.0.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](https://github.com/psf/black/compare/22.8.0...22.10.0)

---
updated-dependencies:
- dependency-name: black
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-07 17:44:31 +05:30
github-actions[bot]
fdbcd4ff52 chore(deps): Update pre-commit hooks (#952)
Co-authored-by: vrslev <vrslev@users.noreply.github.com>
2022-10-07 17:44:14 +05:30
Revant Nandgaonkar
02fcf42c7c fix: pwd add assets volume to queue (#951) 2022-10-06 12:13:56 +05:30
George Everitt
cb16ab9091 Added the --resolve-deps flag to dev install (#950)
Fixes #947
2022-10-05 10:58:44 +05:30
github-actions
f2c660492e chore: Update example.env 2022-10-04 12:29:15 +00:00
github-actions[bot]
a599f8d302 chore(deps): Update pre-commit hooks (#948)
Co-authored-by: vrslev <vrslev@users.noreply.github.com>
2022-10-04 17:58:57 +05:30
github-actions
821a2be993 chore: Update example.env 2022-10-04 10:44:22 +00:00
github-actions
c90e787b6f chore: Update example.env 2022-09-28 10:06:31 +00:00
Arunkumar Ganesan
27ac6e2625 queue short added with mariadb network (#940)
Co-authored-by: ArunG <arung.sap@gmail.com>
2022-09-27 23:18:11 +05:30
github-actions
980eee9154 chore: Update example.env 2022-09-27 10:40:23 +00:00
github-actions[bot]
0446b8ee70 chore(deps): Update pre-commit hooks (#939)
Co-authored-by: vrslev <vrslev@users.noreply.github.com>
2022-09-26 14:56:24 +05:30
github-actions[bot]
4d5c9c4095 chore(deps): Update pre-commit hooks (#937)
Co-authored-by: vrslev <vrslev@users.noreply.github.com>
2022-09-26 03:36:12 +05:30
dependabot[bot]
06cbce1527 chore(deps): bump actions/stale from 5 to 6 (#934)
Bumps [actions/stale](https://github.com/actions/stale) from 5 to 6.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/stale/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-22 15:23:52 +05:30
github-actions
9bbe95fa99 chore: Update example.env 2022-09-20 18:46:21 +00:00
github-actions
c20078f41f chore: Update example.env 2022-09-20 12:05:44 +00:00
github-actions[bot]
8bc5bf6a6d chore(deps): Update pre-commit hooks (#917)
Co-authored-by: vrslev <vrslev@users.noreply.github.com>
2022-09-18 10:36:02 +05:30
Jeffery CHEN Fan
301e4770a4 Update Dockerfile (#926) 2022-09-16 04:06:12 +05:30
github-actions
537e2d5afb chore: Update example.env 2022-09-14 14:04:18 +00:00
github-actions
2421f2befb chore: Update example.env 2022-09-13 12:25:04 +00:00
github-actions
380b1e06bf chore: Update example.env 2022-09-13 10:16:17 +00:00
Revant Nandgaonkar
ec584ba9c8 Deprecate assets builder (#922)
* feat: remove assets-builder image

* ci: remove version 12 builds

* fix: v13 nginx builds
2022-09-12 14:20:05 +05:30
Revant Nandgaonkar
2c1e5425b6 fix(bench): add dependencies to build python using pyenv (#920)
* fix(bench): add dependencies to build python using pyenv

fixes #840

* fix(bench): comment typo
2022-09-09 15:48:22 +05:30
github-actions
81ea33d56e chore: Update example.env 2022-09-06 16:16:36 +00:00
github-actions
61c8de5c08 chore: Update example.env 2022-09-06 11:16:47 +00:00
Revant Nandgaonkar
7fac6f3190 chore(deps): Update pre-commit hooks (#916) 2022-09-06 12:10:52 +05:30
dependabot[bot]
7ebd7d62b9 chore(deps): bump pytest from 7.1.2 to 7.1.3 (#914)
Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.1.2 to 7.1.3.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/7.1.2...7.1.3)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-06 10:06:35 +05:30
dependabot[bot]
2cb93e7315 chore(deps-dev): bump black from 22.6.0 to 22.8.0 (#909)
Bumps [black](https://github.com/psf/black) from 22.6.0 to 22.8.0.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](https://github.com/psf/black/compare/22.6.0...22.8.0)

---
updated-dependencies:
- dependency-name: black
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-01 16:26:17 +05:30
github-actions
8065487c92 chore: Update example.env 2022-08-30 09:39:06 +00:00
github-actions
f60ed87ec8 chore: Update example.env 2022-08-30 07:56:06 +00:00
HENRY Florian
7e5d9c7f53 feat: remove version-12 dependencies (#898)
* feat: remove version-12 dependencies

* chore: Add in comment missing depdencies

* chore: Add in comment missing depdencies

* chore: Add in comment missing depdencies
2022-08-30 12:40:33 +05:30
30 changed files with 416 additions and 176 deletions

View File

@@ -32,7 +32,7 @@ jobs:
uses: docker/setup-buildx-action@v2
- name: Build and test
uses: docker/bake-action@v2.2.0
uses: docker/bake-action@v2.3.0
with:
targets: bench-test
@@ -45,7 +45,7 @@ jobs:
- name: Push
if: ${{ github.repository == 'frappe/frappe_docker' && github.event_name != 'pull_request' }}
uses: docker/bake-action@v2.2.0
uses: docker/bake-action@v2.3.0
with:
targets: bench
push: true

View File

@@ -34,16 +34,6 @@ on:
workflow_dispatch:
jobs:
v12:
uses: ./.github/workflows/docker-build-push.yml
with:
repo: erpnext
version: "12"
push: ${{ github.repository == 'frappe/frappe_docker' && github.event_name != 'pull_request' }}
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
v13:
uses: ./.github/workflows/docker-build-push.yml
with:
@@ -110,7 +100,7 @@ jobs:
steps:
- name: Setup deploy key
uses: webfactory/ssh-agent@v0.5.4
uses: webfactory/ssh-agent@v0.7.0
with:
ssh-private-key: ${{ secrets.HELM_DEPLOY_KEY }}

View File

@@ -43,7 +43,7 @@ jobs:
run: python3 ./.github/scripts/get_latest_tags.py --repo ${{ inputs.repo }} --version ${{ inputs.version }}
- name: Build
uses: docker/bake-action@v2.2.0
uses: docker/bake-action@v2.3.0
with:
push: true
env:
@@ -74,6 +74,6 @@ jobs:
- name: Push
if: ${{ inputs.push }}
uses: docker/bake-action@v2.2.0
uses: docker/bake-action@v2.3.0
with:
push: true

View File

@@ -9,7 +9,7 @@ jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v5
- uses: actions/stale@v7
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: This issue has been automatically marked as stale. You have a week to explain why you believe this is an error.

2
.gitignore vendored
View File

@@ -6,6 +6,8 @@ sites
development/*
!development/README.md
!development/installer.sh
!development/apps-example.json
!development/vscode-example/
# Pycharm

View File

@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.4.0
hooks:
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
@@ -8,28 +8,28 @@ repos:
- id: end-of-file-fixer
- repo: https://github.com/asottile/pyupgrade
rev: v2.37.3
rev: v3.3.1
hooks:
- id: pyupgrade
args: [--py37-plus]
- repo: https://github.com/psf/black
rev: 22.6.0
rev: 22.12.0
hooks:
- id: black
- repo: https://github.com/pycqa/isort
rev: 5.10.1
rev: 5.11.4
hooks:
- id: isort
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.7.1
rev: v3.0.0-alpha.4
hooks:
- id: prettier
- repo: https://github.com/codespell-project/codespell
rev: v2.2.1
rev: v2.2.2
hooks:
- id: codespell
args:
@@ -47,7 +47,7 @@ repos:
types: [shell]
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.8.0.4
rev: v0.9.0.2
hooks:
- id: shellcheck
args: [-x]

View File

@@ -35,6 +35,8 @@ services:
UPSTREAM_REAL_IP_ADDRESS: ${UPSTREAM_REAL_IP_ADDRESS:-127.0.0.1}
UPSTREAM_REAL_IP_HEADER: ${UPSTREAM_REAL_IP_HEADER:-X-Forwarded-For}
UPSTREAM_REAL_IP_RECURSIVE: ${UPSTREAM_REAL_IP_RECURSIVE:-off}
PROXY_READ_TIMOUT: ${PROXY_READ_TIMOUT:-120}
CLIENT_MAX_BODY_SIZE: ${CLIENT_MAX_BODY_SIZE:-50m}
volumes:
- sites:/usr/share/nginx/html/sites
- assets:/usr/share/nginx/html/assets

View File

@@ -7,9 +7,9 @@ You can see that there's four files in this folder:
- `docker-bake.hcl`,
- `compose.override.yaml`.
Python code will `backend.Dockerfile`. JS and CSS (and other fancy frontend stuff) files will be built in `frontend.Dockerfile` if required and served from there.
Python code will be built in `backend.Dockerfile`. JS and CSS (and other fancy frontend stuff) files will be built in `frontend.Dockerfile`.
`docker-bake.hcl` is reference file for cool new [Buildx Bake](https://github.com/docker/buildx/blob/master/docs/reference/buildx_bake.md). It helps to build images without having to remember all build arguments.
`docker-bake.hcl` is reference file for [Buildx Bake](https://github.com/docker/buildx/blob/master/docs/reference/buildx_bake.md). It helps to build images without having to remember all build arguments.
`compose.override.yaml` is [Compose](https://docs.docker.com/compose/compose-file/) override that replaces images from [main compose file](https://github.com/frappe/frappe_docker/blob/main/compose.yaml) so it would use your own images.
@@ -21,7 +21,7 @@ Before the next step—to build images—replace "custom_app" with your app's na
FRAPPE_VERSION=... ERPNEXT_VERSION=... docker buildx bake
```
> 💡 We assume that majority of our users use ERPNext, that's why images in this tutorial are based on ERPNext images. If don't want ERPNext, change base image in Dockerfiles and remove ERPNEXT_VERSION from bake file.
> 💡 We assume that majority of our users use ERPNext, that's why images in this tutorial are based on ERPNext images. If don't want ERPNext, change base image in Dockerfile and remove ERPNEXT_VERSION from bake file. To know more about steps used to build frontend image read comments in `frontend.Dockerfile`.
If something goes wrong feel free to leave an issue.
@@ -41,6 +41,6 @@ Cool! You just containerized your app!
## Installing multiple apps
Both backend and frontend builds contain `install-app` script that places app where it should be. Each call to script installs given app. Usage: `install-app [APP_NAME]`.
Backend builds contain `install-app` script that places app where it should be. Each call to script installs given app. Usage: `install-app [APP_NAME]`.
If you want to install an app from git, clone it locally, COPY in Dockerfile.

View File

@@ -1,13 +1,40 @@
ARG FRAPPE_VERSION
ARG ERPNEXT_VERSION
FROM frappe/assets-builder:${FRAPPE_VERSION} as assets
ARG FRAPPE_VERSION=version-14
# Prepare builder image
FROM frappe/bench:latest as assets
ARG FRAPPE_VERSION=version-14
ARG ERPNEXT_VERSION=version-14
ARG APP_NAME
COPY . apps/${APP_NAME}
RUN install-app ${APP_NAME}
# Setup frappe-bench using FRAPPE_VERSION
RUN bench init --version=${FRAPPE_VERSION} --skip-redis-config-generation --verbose --skip-assets /home/frappe/frappe-bench
WORKDIR /home/frappe/frappe-bench
# Comment following if ERPNext is not required
RUN bench get-app --branch=${ERPNEXT_VERSION} --skip-assets --resolve-deps erpnext
# Copy custom app(s)
COPY --chown=frappe:frappe . apps/${APP_NAME}
# Setup dependencies
RUN bench setup requirements
# Build static assets, copy files instead of symlink
RUN if [ -z "${ERPNEXT_VERSION##*v14*}" ] || [ "$ERPNEXT_VERSION" = "develop" ]; then \
export BUILD_OPTS="--production"; \
fi \
&& FRAPPE_ENV=production bench build --verbose --hard-link ${BUILD_OPTS}
FROM frappe/erpnext-nginx:${ERPNEXT_VERSION}
# Use frappe-nginx image with nginx template and env vars
FROM frappe/frappe-nginx:${FRAPPE_VERSION}
COPY --from=assets /out /usr/share/nginx/html
# Remove existing assets
USER root
RUN rm -fr /usr/share/nginx/html/assets
# Copy built assets
COPY --from=assets /home/frappe/frappe-bench/sites/assets /usr/share/nginx/html/assets
# Use non-root user
USER 1000

View File

@@ -36,6 +36,8 @@ services:
- SHELL=/bin/bash
volumes:
- ..:/workspace:cached
# Enable if you require git cloning
# - ${HOME}/.ssh:/home/frappe/.ssh
working_dir: /workspace/development
ports:
- 8000-8005:8000-8005

View File

@@ -11,7 +11,12 @@ In order to start developing you need to satisfy the following prerequisites:
It is recommended you allocate at least 4GB of RAM to docker:
- [Instructions for Windows](https://docs.docker.com/docker-for-windows/#resources)
- [Instructions for macOS](https://docs.docker.com/docker-for-mac/#resources)
- [Instructions for macOS](https://docs.docker.com/desktop/settings/mac/#advanced)
Here is a screenshot showing the relevant setting in the Help Manual
![image](/docs/images/Docker%20Manual%20Screenshot%20-%20Resources%20section.png)
Here is a screenshot showing the settings in Docker Desktop on Mac
![images](/docs/images/Docker%20Desktop%20Screenshot%20-%20Resources%20section.png)
## Bootstrap Containers for development
@@ -61,6 +66,8 @@ Notes:
### Setup first bench
> Jump to [scripts](#setup-bench--new-site-using-script) section to setup a bench automatically. Alternatively, you can setup a bench manually using below guide.
Run the following commands in the terminal inside the container. You might need to create a new terminal in VSCode.
```shell
@@ -68,17 +75,23 @@ bench init --skip-redis-config-generation frappe-bench
cd frappe-bench
```
For version 13 use Python 3.9 by passing option to `bench init` command,
To setup frappe framework version 14 bench set `PYENV_VERSION` environment variable to `3.10.5` (default) and use NodeJS version 16 (default),
```shell
bench init --skip-redis-config-generation --frappe-branch version-13 --python python3.9 frappe-bench
# Use default environments
bench init --skip-redis-config-generation --frappe-branch version-14 frappe-bench
# Or set environment versions explicitly
nvm use v16
PYENV_VERSION=3.10.5 bench init --skip-redis-config-generation --frappe-branch version-14 frappe-bench
# Switch directory
cd frappe-bench
```
For version 12 use Python 3.7 by passing option to `bench init` command,
To setup frappe framework version 13 bench set `PYENV_VERSION` environment variable to `3.9.9` and use NodeJS version 14,
```shell
bench init --skip-redis-config-generation --frappe-branch version-12 --python python3.7 frappe-bench
nvm use v14
PYENV_VERSION=3.9.9 bench init --skip-redis-config-generation --frappe-branch version-13 frappe-bench
cd frappe-bench
```
@@ -191,6 +204,13 @@ bench get-app --branch version-12 https://github.com/myusername/myapp
bench --site mysite.localhost install-app myapp
```
At the time of this writing, the Payments app has been factored out of the Version 14 ERPNext app and is now a separate app. ERPNext will not install without it, however, so we need to specify `--resolve-deps` command line switch to install it.
```shell
bench get-app --branch version-14 --resolve-deps erpnext
bench --site mysite.localhost install-app erpnext
```
To install ERPNext (from the version-13 branch):
```shell
@@ -198,7 +218,7 @@ bench get-app --branch version-13 erpnext
bench --site mysite.localhost install-app erpnext
```
Note: Both frappe and erpnext must be on branch with same name. e.g. version-12
Note: Both frappe and erpnext must be on branch with same name. e.g. version-14
### Start Frappe without debugging
@@ -212,6 +232,39 @@ You can now login with user `Administrator` and the password you choose when cre
Your website will now be accessible at location [mysite.localhost:8000](http://mysite.localhost:8000)
Note: To start bench with debugger refer section for debugging.
### Setup bench / new site using script
Most developers work with numerous clients and versions. Moreover, apps may be required to be installed by everyone on the team working for a client.
This is simplified using a script to automate the process of creating a new bench / site and installing the required apps.
Create a copy of apps-example.json and name it apps.json
```shell
cp apps-example.json apps.json
```
Maintain a directory of all client apps in apps.json. Note that Maintaining a fork is optional in apps.json. Also `name` should be app name in apps.json (could be different from repo name).
> You may have apps in private repos which may require ssh access. You may use SSH from your home directory on linux (configurable in docker-compose.yml).
After you have created apps.json, run the following command:
```shell
bash installer.sh
```
The script will ask for the following information:
- Client name (from apps.json).
- Bench directory name. If you enter existing bench directory name, it will create a new site in that bench. Else it will create a new bench and site.
- Site name (should end with `.localhost`).
A new bench and / or site is created for the client with following defaults.
- MariaDB root password: `123`
- Admin password: `admin`
### Start Frappe with Visual Studio Code Python Debugging
To enable Python debugging inside Visual Studio Code, you must first install the `ms-python.python` extension inside the container. This should have already happened automatically, but depending on your VSCode config, you can force it by:

View File

@@ -0,0 +1,15 @@
{
"client_name": [
{
"name": "frappe",
"branch": "develop",
"upstream": "git@github.com:frappe/frappe.git",
"fork": "[your fork]"
},
{
"name": "erpnext",
"branch": "develop",
"upstream": "git@github.com:frappe/erpnext.git"
}
]
}

160
development/installer.sh Executable file
View File

@@ -0,0 +1,160 @@
#!/bin/bash
# Developer Note: Run this script in the /workspace/development directory
export NVM_DIR=~/.nvm
# shellcheck disable=SC1091
source $NVM_DIR/nvm.sh
sudo apt -qq update && sudo apt -qq install jq -y
get_client_apps() {
apps=$(jq ".\"$client\"" apps.json)
if [ "$apps" == "null" ]; then
echo "No apps found for $client"
exit 1
fi
}
validate_bench_exists() {
dir="$(pwd)/$bench_name"
if [ -d "$dir" ]; then
echo "Bench already exists. Only site will be created"
is_existing_bench=true
else
is_existing_bench=false
fi
}
validate_branch() {
if [ "$app" == "frappe" ] || [ "$app" == "erpnext" ]; then
if [ "$branch" != "develop" ] && [ "$branch" != "version-14" ] && [ "$branch" != "version-13" ]; then
echo "Branch should be one of develop or version-14 or version-13"
exit 1
fi
fi
}
validate_site() {
if [[ ! "$site_name" =~ ^.*\.localhost$ ]]; then
echo "Site name should end with .localhost"
exit 1
fi
if [ "$is_existing_bench" = true ]; then
validate_site_exists
fi
}
validate_site_exists() {
dir="$(pwd)/$bench_name/sites/$site_name"
if [ -d "$dir" ]; then
echo "Site already exists. Exiting"
exit 1
fi
}
validate_app_exists() {
dir="$(pwd)/apps/$app"
if [ -d "$dir" ]; then
echo "App $app already exists."
is_app_installed=true
else
is_app_installed=false
fi
}
add_fork() {
dir="$(pwd)/apps/$app"
if [ "$fork" != "null" ]; then
git -C "$dir" remote add fork "$fork"
fi
}
install_apps() {
initialize_bench=$1
for row in $(echo "$apps" | jq -r '.[] | @base64'); do
# helper function to retrieve values from dict
_jq() {
echo "${row}" | base64 --decode | jq -r "${1}"
}
app=$(_jq '.name')
branch=$(_jq '.branch')
upstream=$(_jq '.upstream')
fork=$(_jq '.fork')
if [ "$initialize_bench" = true ] && [ "$app" == "frappe" ]; then
init_bench
fi
if [ "$initialize_bench" = false ]; then
get_apps_from_upstream
fi
done
}
init_bench() {
echo "Creating bench $bench_name"
if [ "$branch" == "develop" ] || [ "$branch" == "version-14" ]; then
python_version=python3.10
PYENV_VERSION=3.10.5
NODE_VERSION=v16
elif [ "$branch" == "version-13" ]; then
python_version=python3.9
PYENV_VERSION=3.9.9
NODE_VERSION=v14
fi
nvm use "$NODE_VERSION"
PYENV_VERSION="$PYENV_VERSION" bench init --skip-redis-config-generation --frappe-branch "$branch" --python "$python_version" "$bench_name"
cd "$bench_name" || exit
echo "Setting up config"
bench set-config -g db_host mariadb
bench set-config -g redis_cache redis://redis-cache:6379
bench set-config -g redis_queue redis://redis-queue:6379
bench set-config -g redis_socketio redis://redis-socketio:6379
./env/bin/pip install honcho
}
get_apps_from_upstream() {
validate_app_exists
if [ "$is_app_installed" = false ]; then
bench get-app --branch "$branch" --resolve-deps "$app" "$upstream" && add_fork
fi
if [ "$app" != "frappe" ]; then
all_apps+=("$app")
fi
}
echo "Client Name (from apps.json file)?"
read -r client && client=${client:-develop_client} && get_client_apps
echo "Bench Directory Name? (give name of existing bench to just create a new site) (default: frape-bench)"
read -r bench_name && bench_name=${bench_name:-frappe-bench} && validate_bench_exists
echo "Site Name? (should end with .localhost) (default: site1.localhost)"
read -r site_name && site_name=${site_name:-site1.localhost} && validate_site
if [ "$is_existing_bench" = true ]; then
cd "$bench_name" || exit
else
install_apps true
fi
echo "Getting apps from upstream for $client"
all_apps=() && install_apps false
echo "Creating site $site_name"
bench new-site "$site_name" --mariadb-root-password 123 --admin-password admin --no-mariadb-socket
echo "Installing apps to $site_name"
bench --site "$site_name" install-app "${all_apps[@]}"
bench --site "$site_name" set-config developer_mode 1
bench --site "$site_name" clear-cache

View File

@@ -45,7 +45,7 @@ target "bench-test" {
# Base for all other targets
group "frappe" {
targets = ["frappe-worker", "frappe-nginx", "frappe-socketio", "assets-builder"]
targets = ["frappe-worker", "frappe-nginx", "frappe-socketio"]
}
group "erpnext" {
@@ -73,8 +73,8 @@ target "default-args" {
BENCH_REPO = "${BENCH_REPO}"
FRAPPE_VERSION = "${FRAPPE_VERSION}"
ERPNEXT_VERSION = "${ERPNEXT_VERSION}"
# If `ERPNEXT_VERSION` variable contains "v12" use Python 3.7. If "v13" — 3.9. Else 3.10.
PYTHON_VERSION = can(regex("v12", "${ERPNEXT_VERSION}")) ? "3.7" : can(regex("v13", "${ERPNEXT_VERSION}")) ? "3.9" : "3.10"
PYTHON_VERSION = can(regex("v13", "${ERPNEXT_VERSION}")) ? "3.9.17" : "3.10.12"
NODE_VERSION = can(regex("v13", "${FRAPPE_VERSION}")) ? "14.21.3" : "16.20.1"
}
}
@@ -99,13 +99,6 @@ target "frappe-nginx" {
tags = tag("frappe-nginx", "${FRAPPE_VERSION}")
}
target "assets-builder" {
inherits = ["default-args"]
context = "images/nginx"
target = "assets_builder"
tags = tag("assets-builder", "${FRAPPE_VERSION}")
}
target "erpnext-nginx" {
inherits = ["default-args"]
context = "images/nginx"

View File

@@ -33,6 +33,7 @@ services:
queue-short:
networks:
- bench-network
- mariadb-network
queue-long:
networks:
- bench-network

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

View File

@@ -1,9 +1,9 @@
# Reference: https://github.com/frappe/frappe_docker/blob/main/docs/images-and-compose-files.md
FRAPPE_VERSION=v14.4.3
FRAPPE_VERSION=v14.22.0
# Only with ERPNext override
ERPNEXT_VERSION=v14.0.2
ERPNEXT_VERSION=v14.12.1
DB_PASSWORD=123
@@ -38,3 +38,11 @@ UPSTREAM_REAL_IP_HEADER=
# is replaced by the last address sent in the request header field defined by the real_ip_header directive.
# If recursive search is enabled, the original client address that matches one of the trusted addresses is replaced by the last non-trusted address sent in the request header field.
UPSTREAM_REAL_IP_RECURSIVE=
# All Values Allowed by nginx proxy_read_timeout are allowed, default value is 120s
# Useful if you have longrunning print formats or slow loading sites
PROXY_READ_TIMOUT=
# All Values allowed by nginx client_max_body_size are allowed, default value is 50m
# Necessary if the upload limit in the frappe application is increased
CLIENT_MAX_BODY_SIZE=

View File

@@ -13,9 +13,6 @@ RUN apt-get update \
postgresql-client \
gettext-base \
wget \
# for ERPNext v12
# TODO: Remove after v12 is deprecated
python2 \
# for PDF
libssl-dev \
fonts-cantarell \
@@ -51,6 +48,22 @@ RUN apt-get update \
ssh-client \
# VSCode container requirements
net-tools \
# For pyenv build dependencies
# https://github.com/frappe/frappe_docker/issues/840#issuecomment-1185206895
make \
# For pandas
libbz2-dev \
# For bench execute
libsqlite3-dev \
# For other dependencies
zlib1g-dev \
libreadline-dev \
llvm \
libncurses5-dev \
libncursesw5-dev \
xz-utils \
tk-dev \
liblzma-dev \
&& rm -rf /var/lib/apt/lists/*
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen \
@@ -76,9 +89,6 @@ USER frappe
WORKDIR /home/frappe
# Install Python via pyenv
# Python 3.7 sits here for ERPNext version-12
# TODO: Remove Python 3.7 when version-12 will not be supported
ENV PYTHON_VERSION_V12=3.7.12
ENV PYTHON_VERSION_V13=3.9.9
ENV PYTHON_VERSION=3.10.5
ENV PYENV_ROOT /home/frappe/.pyenv
@@ -86,10 +96,11 @@ ENV PATH $PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH
# From https://github.com/pyenv/pyenv#basic-github-checkout
RUN git clone --depth 1 https://github.com/pyenv/pyenv.git .pyenv \
&& pyenv install $PYTHON_VERSION_V12 \
&& pyenv install $PYTHON_VERSION_V13 \
&& pyenv install $PYTHON_VERSION \
&& pyenv global $PYTHON_VERSION $PYTHON_VERSION_V12 $PYTHON_VERSION_v13 \
&& PYENV_VERSION=$PYTHON_VERSION_V13 pip install --no-cache-dir virtualenv \
&& PYENV_VERSION=$PYTHON_VERSION pip install --no-cache-dir virtualenv \
&& pyenv global $PYTHON_VERSION $PYTHON_VERSION_v13 \
&& sed -Ei -e '/^([^#]|$)/ {a export PYENV_ROOT="/home/frappe/.pyenv" a export PATH="$PYENV_ROOT/bin:$PATH" a ' -e ':a' -e '$!{n;ba};}' ~/.profile \
&& echo 'eval "$(pyenv init --path)"' >>~/.profile \
&& echo 'eval "$(pyenv init -)"' >>~/.bashrc
@@ -100,20 +111,20 @@ ENV PATH /home/frappe/.local/bin:$PATH
# Skip editable-bench warning
# https://github.com/frappe/bench/commit/20560c97c4246b2480d7358c722bc9ad13606138
RUN git clone ${GIT_REPO} --depth 1 -b ${GIT_BRANCH} .bench \
&& pip install --user -e .bench \
&& pip install --no-cache-dir --user -e .bench \
&& echo "export PATH=/home/frappe/.local/bin:\$PATH" >>/home/frappe/.bashrc \
&& echo "export BENCH_DEVELOPER=1" >>/home/frappe/.bashrc
# Install Node via nvm
ENV NODE_VERSION=14.18.1
ENV NODE_VERSION_FRAPPEV11=10.24.1
ENV NODE_VERSION_14=14.19.3
ENV NODE_VERSION=16.18.0
ENV NVM_DIR /home/frappe/.nvm
ENV PATH ${NVM_DIR}/versions/node/v${NODE_VERSION}/bin/:${PATH}
RUN wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash \
&& . ${NVM_DIR}/nvm.sh \
&& nvm install ${NODE_VERSION_FRAPPEV11} \
&& nvm use v${NODE_VERSION_FRAPPEV11} \
&& nvm install ${NODE_VERSION_14} \
&& nvm use v${NODE_VERSION_14} \
&& npm install -g yarn \
&& nvm install ${NODE_VERSION} \
&& nvm use v${NODE_VERSION} \

View File

@@ -1,46 +1,34 @@
FROM node:14-bullseye-slim as assets_builder
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
git \
build-essential \
python \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /frappe-bench
RUN mkdir -p sites/assets /out/assets \
&& echo frappe >sites/apps.txt
FROM frappe/bench:latest as assets_builder
ARG FRAPPE_VERSION
ARG FRAPPE_REPO=https://github.com/frappe/frappe
# Install development node modules
RUN git clone --depth 1 -b ${FRAPPE_VERSION} ${FRAPPE_REPO} apps/frappe \
&& yarn --cwd apps/frappe \
# TODO: Currently `yarn run production` doesn't create .build on develop branch: https://github.com/frappe/frappe/issues/15396
&& if [ ! -f sites/.build ]; then touch sites/.build; fi \
&& cp sites/.build /out
ARG PYTHON_VERSION
ARG NODE_VERSION
ENV NVM_DIR=/home/frappe/.nvm
ENV PATH ${NVM_DIR}/versions/node/v${NODE_VERSION}/bin/:${PATH}
RUN PYENV_VERSION=${PYTHON_VERSION} bench init --version=${FRAPPE_VERSION} --frappe-path=${FRAPPE_REPO} --skip-redis-config-generation --verbose --skip-assets /home/frappe/frappe-bench
COPY install-app.sh /usr/local/bin/install-app
WORKDIR /home/frappe/frappe-bench
FROM assets_builder as frappe_assets
RUN install-app frappe
RUN bench setup requirements \
&& if [ -z "${FRAPPE_VERSION##*v14*}" ] || [ "$FRAPPE_VERSION" = "develop" ]; then \
export BUILD_OPTS="--production";\
fi \
&& FRAPPE_ENV=production bench build --verbose --hard-link ${BUILD_OPTS}
FROM assets_builder as erpnext_assets
ARG PAYMENTS_VERSION=develop
ARG PAYMENTS_REPO=https://github.com/frappe/payments
ARG ERPNEXT_VERSION
ARG ERPNEXT_REPO=https://github.com/frappe/erpnext
RUN if [ -z "${ERPNEXT_VERSION##*v14*}" ] || [ "$ERPNEXT_VERSION" = "develop" ]; then \
git clone --depth 1 -b ${PAYMENTS_VERSION} ${PAYMENTS_REPO} apps/payments && install-app payments; \
RUN bench get-app --branch=${ERPNEXT_VERSION} --skip-assets --resolve-deps erpnext ${ERPNEXT_REPO}\
&& if [ -z "${ERPNEXT_VERSION##*v14*}" ] || [ "$ERPNEXT_VERSION" = "develop" ]; then \
export BUILD_OPTS="--production"; \
fi \
&& git clone --depth 1 -b ${ERPNEXT_VERSION} ${ERPNEXT_REPO} apps/erpnext \
&& install-app erpnext
&& FRAPPE_ENV=production bench build --verbose --hard-link ${BUILD_OPTS}
FROM alpine/git as bench
@@ -49,10 +37,14 @@ FROM alpine/git as bench
ARG BENCH_REPO=https://github.com/frappe/bench
RUN git clone --depth 1 ${BENCH_REPO} /tmp/bench \
&& mkdir /out \
&& mv /tmp/bench/bench/config/templates/502.html /out/
&& mv /tmp/bench/bench/config/templates/502.html /out \
&& touch /out/.build
FROM nginxinc/nginx-unprivileged:1.23.3-alpine as frappe
FROM nginxinc/nginx-unprivileged:1.23.1-alpine as frappe
# Set default ENV variables for backwards compatibility
ENV PROXY_READ_TIMOUT=120
ENV CLIENT_MAX_BODY_SIZE=50m
# https://github.com/nginxinc/docker-nginx-unprivileged/blob/main/stable/alpine/20-envsubst-on-templates.sh
COPY nginx-template.conf /etc/nginx/templates/default.conf.template
@@ -60,11 +52,11 @@ COPY nginx-template.conf /etc/nginx/templates/default.conf.template
COPY entrypoint.sh /docker-entrypoint.d/frappe-entrypoint.sh
COPY --from=bench /out /usr/share/nginx/html/
COPY --from=frappe_assets /out /usr/share/nginx/html
COPY --from=frappe_assets /home/frappe/frappe-bench/sites/assets /usr/share/nginx/html/assets
USER 1000
FROM frappe as erpnext
COPY --from=erpnext_assets /out /usr/share/nginx/html
COPY --from=erpnext_assets /home/frappe/frappe-bench/sites/assets /usr/share/nginx/html/assets

View File

@@ -1,32 +0,0 @@
#!/bin/bash
set -e
set -x
APP=$1
cleanup() {
rm -rf "apps/$APP"
rm -rf sites/assets/*
}
cd /frappe-bench
if ! test -d "apps/$APP/$APP/public"; then
cleanup
exit 0
fi
# Add all not built assets
cp -r "apps/$APP/$APP/public" "/out/assets/$APP"
# Add production node modules
yarn --cwd "apps/$APP" --prod
cp -r "apps/$APP/node_modules" "/out/assets/$APP/node_modules"
# Add built assets
yarn --cwd "apps/$APP"
echo "$APP" >>sites/apps.txt
yarn --cwd apps/frappe run production --app "$APP"
cp -r sites/assets /out
cleanup

View File

@@ -37,7 +37,7 @@ server {
location ~ ^/protected/(.*) {
internal;
try_files /sites/$http_host/$1 =404;
try_files /sites/${FRAPPE_SITE_NAME_HEADER}/$1 =404;
}
location /socket.io {
@@ -72,7 +72,7 @@ server {
proxy_set_header X-Frappe-Site-Name ${FRAPPE_SITE_NAME_HEADER};
proxy_set_header Host $host;
proxy_set_header X-Use-X-Accel-Redirect True;
proxy_read_timeout 120;
proxy_read_timeout ${PROXY_READ_TIMOUT};
proxy_redirect off;
proxy_pass http://backend-server;
@@ -87,7 +87,7 @@ server {
# optimizations
sendfile on;
keepalive_timeout 15;
client_max_body_size 50m;
client_max_body_size ${CLIENT_MAX_BODY_SIZE};
client_body_buffer_size 16K;
client_header_buffer_size 1k;

View File

@@ -2,10 +2,20 @@ FROM alpine/git as builder
ARG FRAPPE_VERSION
ARG FRAPPE_REPO=https://github.com/frappe/frappe
RUN apk add -U jq
RUN git clone --depth 1 -b ${FRAPPE_VERSION} ${FRAPPE_REPO} /opt/frappe
RUN jq --argjson dependencies "$(jq '.dependencies | INDEX( "express", "redis", "socket.io", "superagent" ) as $keep | \
del( \
. | objects | \
.[ \
keys_unsorted[] | \
select( $keep[ . ] | not ) \
] \
)' /opt/frappe/package.json)" '.dependencies = $dependencies | del(.scripts.prepare)' /opt/frappe/package.json > /opt/frappe/dependencies.json && \
mv /opt/frappe/dependencies.json /opt/frappe/package.json
FROM node:17-alpine
# NodeJS LTS
FROM node:18-alpine
RUN addgroup -S frappe \
&& adduser -S frappe -G frappe
@@ -14,11 +24,10 @@ USER frappe
WORKDIR /home/frappe/frappe-bench
RUN mkdir -p sites apps/frappe
COPY --chown=frappe:frappe --from=builder /opt/frappe/socketio.js /opt/frappe/node_utils.js apps/frappe/
COPY --chown=frappe:frappe package.json apps/frappe/
COPY --chown=frappe:frappe --from=builder /opt/frappe/package.json /opt/frappe/socketio.js /opt/frappe/node_utils.js apps/frappe/
RUN cd apps/frappe \
&& npm install
&& npm install --omit=dev
WORKDIR /home/frappe/frappe-bench/sites

View File

@@ -1,13 +0,0 @@
{
"name": "frappe-socketio",
"version": "1.0.1",
"description": "Frappe SocketIO Server",
"author": "Revant Nandgaonkar",
"license": "MIT",
"dependencies": {
"express": "^4.17.1",
"redis": "^3.1.1",
"socket.io": "^2.4.0",
"superagent": "^5.1.0"
}
}

View File

@@ -11,13 +11,13 @@ RUN apt-get update \
RUN useradd -ms /bin/bash frappe
USER frappe
RUN mkdir -p /home/frappe/frappe-bench/apps /home/frappe/frappe-bench/logs /home/frappe/frappe-bench/sites
RUN mkdir -p /home/frappe/frappe-bench/apps /home/frappe/frappe-bench/logs /home/frappe/frappe-bench/sites /home/frappe/frappe-bench/config
WORKDIR /home/frappe/frappe-bench
USER root
RUN pip install -U pip wheel \
RUN pip install --no-cache-dir -U pip wheel \
&& python -m venv env \
&& env/bin/pip install -U pip wheel
&& env/bin/pip install --no-cache-dir -U pip wheel
COPY install-app.sh /usr/local/bin/install-app
@@ -65,15 +65,27 @@ RUN --mount=type=cache,target=/root/.cache/pip \
&& git clone --depth 1 -b ${ERPNEXT_VERSION} ${ERPNEXT_REPO} apps/erpnext \
&& install-app erpnext
FROM base as configured_base
ARG WKHTMLTOPDF_VERSION=0.12.6-1
ARG NODE_VERSION
ENV NVM_DIR=/home/frappe/.nvm
ENV PATH ${NVM_DIR}/versions/node/v${NODE_VERSION}/bin/:${PATH}
RUN apt-get update \
# Setup Node lists
&& apt-get install --no-install-recommends -y curl \
&& curl -sL https://deb.nodesource.com/setup_14.x | bash - \
&& apt-get install --no-install-recommends -y curl git \
# NodeJS with NVM
&& mkdir -p ${NVM_DIR} \
&& curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash \
&& . ${NVM_DIR}/nvm.sh \
&& nvm install ${NODE_VERSION} \
&& nvm use v${NODE_VERSION} \
&& npm install -g yarn \
&& nvm alias default v${NODE_VERSION} \
&& rm -rf ${NVM_DIR}/.cache \
&& echo 'export NVM_DIR="/home/frappe/.nvm"' >>~/.bashrc \
&& echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm' >> ~/.bashrc \
&& echo '[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion' >> ~/.bashrc \
# Install wkhtmltopdf with patched qt
&& if [ "$(uname -m)" = "aarch64" ]; then export ARCH=arm64; fi \
&& if [ "$(uname -m)" = "x86_64" ]; then export ARCH=amd64; fi \
@@ -92,8 +104,7 @@ RUN apt-get update \
# For healthcheck
wait-for-it \
jq \
# other
nodejs \
# Clean up
&& rm -rf /var/lib/apt/lists/*
COPY pretend-bench.sh /usr/local/bin/bench
@@ -127,8 +138,9 @@ USER frappe
# Split frappe and erpnext to reduce image size (because of frappe-bench/env/ directory)
FROM configured_base as erpnext
COPY --from=erpnext_builder /home/frappe/frappe-bench/apps /home/frappe/frappe-bench/apps
COPY --from=erpnext_builder /home/frappe/frappe-bench/env /home/frappe/frappe-bench/env
COPY --from=erpnext_builder /home/frappe/frappe-bench/sites/apps.txt /home/frappe/frappe-bench/sites/
COPY --from=erpnext_builder --chown=frappe:frappe /home/frappe/frappe-bench/apps /home/frappe/frappe-bench/apps
COPY --from=erpnext_builder --chown=frappe:frappe /home/frappe/frappe-bench/env /home/frappe/frappe-bench/env
COPY --from=erpnext_builder --chown=frappe:frappe /home/frappe/frappe-bench/sites/apps.txt /home/frappe/frappe-bench/sites/
USER frappe

View File

@@ -6,8 +6,6 @@ APP=$1
cd /home/frappe/frappe-bench
rm -rf "apps/$APP/.git"
env/bin/pip install -e "apps/$APP"
echo "$APP" >>sites/apps.txt

View File

@@ -1,5 +1,8 @@
x-erpnext-backend-image: &erpnext_backend_image
image: frappe/erpnext-worker:${ERPNEXT_VERSION:?No ERPNext version set}
volumes:
- sites:/home/frappe/frappe-bench/sites
- assets:/home/frappe/frappe-bench/sites/assets:ro
services:
configurator:

25
pwd.yml
View File

@@ -2,7 +2,7 @@ version: "3"
services:
backend:
image: frappe/erpnext-worker:v14.0.2
image: frappe/erpnext-worker:v14.12.1
deploy:
restart_policy:
condition: on-failure
@@ -11,7 +11,7 @@ services:
- assets:/home/frappe/frappe-bench/sites/assets
configurator:
image: frappe/erpnext-worker:v14.0.2
image: frappe/erpnext-worker:v14.12.1
command:
- configure.py
environment:
@@ -25,7 +25,7 @@ services:
- sites:/home/frappe/frappe-bench/sites
create-site:
image: frappe/erpnext-worker:v14.0.2
image: frappe/erpnext-worker:v14.12.1
deploy:
restart_policy:
condition: on-failure
@@ -76,7 +76,7 @@ services:
- db-data:/var/lib/mysql
frontend:
image: frappe/erpnext-nginx:v14.0.2
image: frappe/erpnext-nginx:v14.12.1
deploy:
restart_policy:
condition: on-failure
@@ -87,6 +87,8 @@ services:
UPSTREAM_REAL_IP_ADDRESS: 127.0.0.1
UPSTREAM_REAL_IP_HEADER: X-Forwarded-For
UPSTREAM_REAL_IP_RECURSIVE: "off"
PROXY_READ_TIMOUT: 120
CLIENT_MAX_BODY_SIZE: 50m
volumes:
- sites:/usr/share/nginx/html/sites
- assets:/usr/share/nginx/html/assets
@@ -94,7 +96,7 @@ services:
- "8080:8080"
queue-default:
image: frappe/erpnext-worker:v14.0.2
image: frappe/erpnext-worker:v14.12.1
deploy:
restart_policy:
condition: on-failure
@@ -105,9 +107,10 @@ services:
- default
volumes:
- sites:/home/frappe/frappe-bench/sites
- assets:/home/frappe/frappe-bench/sites/assets
queue-long:
image: frappe/erpnext-worker:v14.0.2
image: frappe/erpnext-worker:v14.12.1
deploy:
restart_policy:
condition: on-failure
@@ -118,9 +121,10 @@ services:
- long
volumes:
- sites:/home/frappe/frappe-bench/sites
- assets:/home/frappe/frappe-bench/sites/assets
queue-short:
image: frappe/erpnext-worker:v14.0.2
image: frappe/erpnext-worker:v14.12.1
deploy:
restart_policy:
condition: on-failure
@@ -131,6 +135,7 @@ services:
- short
volumes:
- sites:/home/frappe/frappe-bench/sites
- assets:/home/frappe/frappe-bench/sites/assets
redis-queue:
image: redis:6.2-alpine
@@ -157,7 +162,7 @@ services:
- redis-socketio-data:/data
scheduler:
image: frappe/erpnext-worker:v14.0.2
image: frappe/erpnext-worker:v14.12.1
deploy:
restart_policy:
condition: on-failure
@@ -166,14 +171,16 @@ services:
- schedule
volumes:
- sites:/home/frappe/frappe-bench/sites
- assets:/home/frappe/frappe-bench/sites/assets
websocket:
image: frappe/frappe-socketio:v14.4.3
image: frappe/frappe-socketio:v14.22.0
deploy:
restart_policy:
condition: on-failure
volumes:
- sites:/home/frappe/frappe-bench/sites
- assets:/home/frappe/frappe-bench/sites/assets
volumes:
assets:

View File

@@ -1,3 +1,3 @@
frappe @ git+https://github.com/frappe/frappe.git
boto3-stubs[s3]
black==22.6.0
black==22.12.0

View File

@@ -1 +1 @@
pytest==7.1.2
pytest==7.2.0