Mac下如何在docker下安装erpnect
时间: 2024-02-19 21:00:25 浏览: 196
在Mac下使用Docker安装ERPNext的步骤如下:
1. 安装Docker和Docker Compose
首先需要安装Docker和Docker Compose。可以从Docker的官方网站下载安装程序。
2. 创建ERPNext的Docker Compose文件
可以从ERPNext的Github存储库下载Docker Compose文件模板,然后在本地复制和编辑。以下是一个示例文件:
```
version: '3'
services:
db:
image: mariadb:10.3
restart: always
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: erpnext
volumes:
- erpnext-db:/var/lib/mysql
networks:
- erpnext-net
redis-cache:
image: redis:latest
restart: always
volumes:
- erpnext-redis-cache:/data
networks:
- erpnext-net
redis-queue:
image: redis:latest
restart: always
volumes:
- erpnext-redis-queue:/data
networks:
- erpnext-net
erpnext-worker-default:
image: frappe/erpnext-worker:<version>
command: worker
environment:
WORKER_TYPE: default
FRAPPE_WORKER_PORT: 3000
volumes:
- erpnext-assets:/home/frappe/frappe-bench/sites/assets
- erpnext-sites:/home/frappe/frappe-bench/sites
- erpnext-backups:/home/frappe/backups
depends_on:
- db
- redis-cache
- redis-queue
networks:
- erpnext-net
erpnext-worker-short:
image: frappe/erpnext-worker:<version>
command: worker
environment:
WORKER_TYPE: short
FRAPPE_WORKER_PORT: 3000
volumes:
- erpnext-assets:/home/frappe/frappe-bench/sites/assets
- erpnext-sites:/home/frappe/frappe-bench/sites
- erpnext-backups:/home/frappe/backups
depends_on:
- db
- redis-cache
- redis-queue
networks:
- erpnext-net
erpnext-web:
image: frappe/erpnext-nginx:<version>
ports:
- "80:80"
- "443:443"
environment:
WEB_SERVER_PORTS: 80,443
volumes:
- erpnext-assets:/home/frappe/frappe-bench/sites/assets
- erpnext-sites:/home/frappe/frappe-bench/sites
depends_on:
- erpnext-worker-default
- erpnext-worker-short
networks:
- erpnext-net
volumes:
erpnext-db:
erpnext-redis-cache:
erpnext-redis-queue:
erpnext-assets:
erpnext-sites:
erpnext-backups:
networks:
erpnext-net:
```
在文件中,需要将`<version>`替换为所需的ERPNext版本号。
3. 启动ERPNext
使用以下命令启动ERPNext:
```
docker-compose up -d
```
4. 访问ERPNext
在浏览器中访问`http://localhost`,将看到ERPNext登录页面。首次访问时,需要创建管理员帐户。
以上是在Mac下使用Docker安装ERPNext的步骤。
阅读全文