PromucFlow_constructor/deploy/template/docker-compose.yml.sh
Trisha Anand fd0f23b9cc
Database credentials encryption in MongoDB (#80)
* Encrypting the password stored in AuthenticationDTO for every db.

* Adding comment to the properties file to denote that adding encryption salt and password are mandatory to the server coming up.

* Added the encryption salt and password to server.yml to allow the github actions to succeed.

* Adding database migration to encrypt the existing passwords for authentication object (used for storing db connection username/password)

Changes to the installation script install.sh:

1. Instead of overwriting the existing encryption password or salt, giving the user an option to conserve the previous encryption credentials to ensure that the developer users do not lose access to their database configurations (passwords).
2. Added another file for writing encryption credentials (encryption.env) to ensure that we dont delete the encryption password and salt by mistake.
2020-07-14 14:45:08 +05:30

81 lines
1.6 KiB
Bash

#!/bin/sh
if [ -f docker-compose.yml ]
then
echo "file docker-compose.yml already exists"
else
touch docker-compose.yml
fi
cat > docker-compose.yml << EOF
version: "3.7"
services:
nginx:
image: appsmith/appsmith-editor
env_file: ./docker.env
ports:
- "80:80"
- "443:443"
volumes:
- ./data/nginx:/etc/nginx/conf.d
- ./data/certbot/conf:/etc/letsencrypt
- ./data/certbot/www:/var/www/certbot
command: "/bin/sh -c 'while :; do sleep 6h & wait \$\${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
depends_on:
- appsmith-internal-server
networks:
- appsmith
certbot:
image: certbot/certbot
volumes:
- ./data/certbot/conf:/etc/letsencrypt
- ./data/certbot/www:/var/www/certbot
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait \$\${!}; done;'"
networks:
- appsmith
appsmith-internal-server:
image: appsmith/appsmith-server:latest
env_file:
- ./docker.env
- ./encryption.env
ports:
- "8080:8080"
links:
- mongo
depends_on:
- mongo
networks:
- appsmith
mongo:
image: mongo
ports:
- "27017:27017"
environment:
- MONGO_INITDB_DATABASE=appsmith
- MONGO_INITDB_ROOT_USERNAME=$mongo_root_user
- MONGO_INITDB_ROOT_PASSWORD=$mongo_root_password
volumes:
- ./data/mongo/db:/data/db
- ./data/mongo/init.js:/docker-entrypoint-initdb.d/init.js:ro
networks:
- appsmith
redis:
image: redis
ports:
- "6379:6379"
networks:
- appsmith
networks:
appsmith:
driver: bridge
EOF