mailcow/012-build-nginx.sh

31 lines
913 B
Bash
Raw Normal View History

2016-12-10 03:39:02 +08:00
#!/bin/bash
. mailcow.conf
NAME="nginx-mailcow"
echo "Stopping and removing containers with name tag ${NAME}..."
if [[ ! -z $(docker ps -af "name=${NAME}" -q) ]]; then
docker stop $(docker ps -af "name=${NAME}" -q)
docker rm $(docker ps -af "name=${NAME}" -q)
fi
sed -i "s#database_name.*#database_name = \"${DBNAME}\";#" data/web/inc/vars.inc.php
sed -i "s#database_user.*#database_user = \"${DBUSER}\";#" data/web/inc/vars.inc.php
sed -i "s#database_pass.*#database_pass = \"${DBPASS}\";#" data/web/inc/vars.inc.php
docker run \
2016-12-10 04:10:11 +08:00
-p 443:443 \
2016-12-12 03:09:01 +08:00
--expose 8081 \
2016-12-10 03:39:02 +08:00
--name ${NAME} \
-v ${PWD}/data/web:/web:ro \
2016-12-10 07:39:27 +08:00
-v ${PWD}/data/conf/rspamd/dynmaps:/dynmaps:ro \
2016-12-10 04:10:11 +08:00
-v ${PWD}/data/assets/ssl/:/etc/ssl/mail/:ro \
2016-12-10 03:39:02 +08:00
-v ${PWD}/data/conf/nginx/:/etc/nginx/conf.d/:ro \
--network=${DOCKER_NETWORK} \
-h nginx \
--network-alias=nginx \
2016-12-14 16:06:14 +08:00
-d andryyy/mailcow-dockerized:nginx
/bin/bash ./fix-permissions.sh