fix: added docker compose files
This commit is contained in:
parent
c1a5f6b70a
commit
1be19fbd4b
32
docker/docker-compose.yml
Normal file
32
docker/docker-compose.yml
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
version: "3.7"
|
||||||
|
name: crm
|
||||||
|
services:
|
||||||
|
mariadb:
|
||||||
|
image: mariadb:10.6
|
||||||
|
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:
|
||||||
40
docker/init.sh
Normal file
40
docker/init.sh
Normal file
@ -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
|
||||||
|
|
||||||
|
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 crm
|
||||||
|
|
||||||
|
bench new-site crm.localhost \
|
||||||
|
--force \
|
||||||
|
--mariadb-root-password 123 \
|
||||||
|
--admin-password admin \
|
||||||
|
--no-mariadb-socket
|
||||||
|
|
||||||
|
bench --site crm.localhost install-app crm
|
||||||
|
bench --site crm.localhost set-config developer_mode 1
|
||||||
|
bench --site crm.localhost clear-cache
|
||||||
|
bench --site crm.localhost set-config mute_emails 1
|
||||||
|
bench --site crm.localhost add-user alex@example.com --first-name Alex --last-name Scott --password 123 --user-type 'System User' --add-role 'crm Admin'
|
||||||
|
bench use crm.localhost
|
||||||
|
|
||||||
|
bench start
|
||||||
Loading…
x
Reference in New Issue
Block a user