受欢迎的博客标签

How To Run nopCommerce On Linux Using Docker(via docker run using the official nopcommerceteam/nopcommerce image)

Published

Docker Image:https://hub.docker.com/r/nopcommerceteam/nopcommerce

tag:https://hub.docker.com/r/nopcommerceteam/nopcommerce/tags

docker pull nopcommerceteam/nopcommerce:4.90.3

 

mount the folder from your container to your host to persist runtime files like appsettings.json and plugins.json.

docker run -d \
  --name nopcommerce \
  --network nop_net \
  -p 80:80 \
  -v /data/nopcommerce:/app/App_Data \
  -v /data/nopcommerce_images:/app/wwwroot/images \
  -v /data/nopcommerce_logs:/app/Logs \
  nopcommerce_image



docker run -d \
  --name nopcommerce \
  --network host \
  -v /datadocker/nopcommerce/App_Data:/app/App_Data \
  -v /datadocker/nopcommerce/bin:/app/bin \
  -v /datadocker/nopcommerce/logs:/app/logs \
  -v /datadocker/nopcommerce/wwwroot/images:/app/wwwroot/images \
  -v /datadocker/nopcommerce/wwwroot/files:/app/wwwroot/files \
  nopcommerceteam/nopcommerce:4.90.3

/app/App_Data: 这里存放着 dataSettings.json(数据库连接信息)和内置的持久化密钥。

/app/wwwroot:保存

商品图片
上传文件

/app/Themes
主题

app/plugins: 如果你以后安装了第三方插件,它们会存在这里
插件

/app/Views


是必须持久化的目录。

RUN chmod 775 App_Data \
              App_Data/DataProtectionKeys \
              bin \
              logs \
              Plugins \
              wwwroot/bundles \
              wwwroot/db_backups \
              wwwroot/files/exportimport \
              wwwroot/icons \
              wwwroot/images \
              wwwroot/images/thumbs \
              wwwroot/images/uploaded \
			  wwwroot/sitemaps

https://github.com/nopSolutions/nopCommerce/blob/develop/Dockerfile

include Plugins, Themes and Content folder