-
Notifications
You must be signed in to change notification settings - Fork 325
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2077 from RitvikSardana/docker-setup
feat: docker setup
- Loading branch information
Showing
2 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
version: "3.7" | ||
services: | ||
mariadb: | ||
image: mariadb:10.8 | ||
command: | ||
- --character-set-server=utf8mb4 | ||
- --collation-server=utf8mb4_unicode_ci | ||
- --skip-character-set-client-handshake | ||
- --skip-innodb-read-only-compressed # Temporary fix for MariaDB 10.6 | ||
environment: | ||
MYSQL_ROOT_PASSWORD: 123 | ||
volumes: | ||
- mariadb-data:/var/lib/mysql | ||
|
||
redis: | ||
image: redis:alpine | ||
|
||
frappe: | ||
image: frappe/bench:latest | ||
command: bash /workspace/init.sh | ||
environment: | ||
- SHELL=/bin/bash | ||
working_dir: /home/frappe | ||
volumes: | ||
- .:/workspace | ||
ports: | ||
- 8000:8000 | ||
- 9000:9000 | ||
|
||
volumes: | ||
mariadb-data: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!bin/bash | ||
|
||
if [ -d "/home/frappe/frappe-bench/apps/frappe" ]; then | ||
echo "Bench already exists, skipping init" | ||
cd frappe-bench | ||
bench start | ||
else | ||
echo "Creating new bench..." | ||
fi | ||
|
||
bench init --skip-redis-config-generation frappe-bench --version version-15 | ||
|
||
cd frappe-bench | ||
|
||
# Use containers instead of localhost | ||
bench set-mariadb-host mariadb | ||
bench set-redis-cache-host redis:6379 | ||
bench set-redis-queue-host redis:6379 | ||
bench set-redis-socketio-host redis:6379 | ||
|
||
# Remove redis, watch from Procfile | ||
sed -i '/redis/d' ./Procfile | ||
sed -i '/watch/d' ./Procfile | ||
|
||
bench get-app helpdesk --branch main | ||
|
||
bench new-site helpdesk.localhost \ | ||
--force \ | ||
--mariadb-root-password 123 \ | ||
--admin-password admin \ | ||
--no-mariadb-socket | ||
|
||
bench --site helpdesk.localhost install-app helpdesk | ||
bench --site helpdesk.localhost set-config developer_mode 1 | ||
bench --site helpdesk.localhost set-config mute_emails 1 | ||
bench --site helpdesk.localhost set-config server_script_enabled 1 | ||
bench --site helpdesk.localhost clear-cache | ||
bench use helpdesk.localhost | ||
|
||
bench start |