diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fb58dee --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.env +data diff --git a/README.md b/README.md index 96d67b8..1167e18 100644 --- a/README.md +++ b/README.md @@ -34,14 +34,8 @@ $ git clone https://github.com/MISP/misp-docker $ cd misp-docker ``` ## Fix your environment -Edit the docker-compose.yml and change the following environment variables: -* MYSQL_DATABASE -* MYSQL_USER -* MYSQL_PASSWORD -* MYSQL_ROOT_PASSWORD -* MYSQL_MISP_PASSWORD -* MISP_ADMIN_PASSPHRASE -* Changed the volumes to match your local filesystem +Copy template.env to .env (on the root directory) and edit the environment variables at .env file + ## Build the containers ``` diff --git a/docker-compose-nginx.yml b/docker-compose-nginx.yml index a02e108..0c21461 100644 --- a/docker-compose-nginx.yml +++ b/docker-compose-nginx.yml @@ -18,27 +18,27 @@ services: restart: unless-stopped volumes: - /dev/urandom:/dev/random - - /data/misp/web:/var/www/MISP + - ${DATA_DIR}/web:/var/www/MISP environment: - MYSQL_HOST=db - - MYSQL_DATABASE=misp - - MYSQL_USER=misp - - MYSQL_PASSWORD=misp - - MISP_ADMIN_EMAIL=admin@admin.test - - MISP_ADMIN_PASSPHRASE=admin - - MISP_BASEURL=http:\/\/misp\.test - - POSTFIX_RELAY_HOST=relay.fqdn - - TIMEZONE=Europe/Brussels + - MYSQL_DATABASE=${MYSQL_DATABASE} + - MYSQL_USER=${MYSQL_USER} + - MYSQL_PASSWORD=${MYSQL_PASSWORD} + - MISP_ADMIN_EMAIL=${MISP_ADMIN_EMAIL} + - MISP_ADMIN_PASSPHRASE=${MISP_ADMIN_PASSPHRASE} + - MISP_BASEURL=${MISP_BASEURL} + - POSTFIX_RELAY_HOST=${POSTFIX_RELAY_HOST} + - TIMEZONE=${TIMEZONE} db: container_name: misp_db image: mysql/mysql-server:5.7 restart: unless-stopped volumes: - - /data/misp/db:/var/lib/mysql + - ${DATA_DIR}/db:/var/lib/mysql environment: - - MYSQL_DATABASE=misp - - MYSQL_USER=misp - - MYSQL_PASSWORD=misp - - MYSQL_ROOT_PASSWORD=misp + - MYSQL_DATABASE=${MYSQL_DATABASE} + - MYSQL_USER=${MYSQL_USER} + - MYSQL_PASSWORD=${MYSQL_PASSWORD} + - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} diff --git a/docker-compose.yml b/docker-compose.yml index e9fd021..59d2814 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,26 +12,26 @@ services: - "80:80" volumes: - /dev/urandom:/dev/random - - /data/misp/web:/var/www/MISP + - ${DATA_DIR}/web:/var/www/MISP environment: - MYSQL_HOST=db - - MYSQL_DATABASE=misp - - MYSQL_USER=misp - - MYSQL_PASSWORD=misp - - MISP_ADMIN_EMAIL=admin@admin.test - - MISP_ADMIN_PASSPHRASE=admin - - MISP_BASEURL=http:\/\/misp\.test - - POSTFIX_RELAY_HOST=relay.fqdn - - TIMEZONE=Europe/Brussels + - MYSQL_DATABASE=${MYSQL_DATABASE} + - MYSQL_USER=${MYSQL_USER} + - MYSQL_PASSWORD=${MYSQL_PASSWORD} + - MISP_ADMIN_EMAIL=${MISP_ADMIN_EMAIL} + - MISP_ADMIN_PASSPHRASE=${MISP_ADMIN_PASSPHRASE} + - MISP_BASEURL=${MISP_BASEURL} + - POSTFIX_RELAY_HOST=${POSTFIX_RELAY_HOST} + - TIMEZONE=${TIMEZONE} db: container_name: misp_db image: mysql/mysql-server:5.7 restart: unless-stopped volumes: - - /data/misp/db:/var/lib/mysql + - ${DATA_DIR}/db:/var/lib/mysql environment: - - MYSQL_DATABASE=misp - - MYSQL_USER=misp - - MYSQL_PASSWORD=misp - - MYSQL_ROOT_PASSWORD=misp + - MYSQL_DATABASE=${MYSQL_DATABASE} + - MYSQL_USER=${MYSQL_USER} + - MYSQL_PASSWORD=${MYSQL_PASSWORD} + - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} diff --git a/template.env b/template.env new file mode 100644 index 0000000..f23d46b --- /dev/null +++ b/template.env @@ -0,0 +1,13 @@ +MYSQL_DATABASE=misp +MYSQL_USER=misp +MYSQL_PASSWORD=misp +MYSQL_ROOT_PASSWORD=misp + +MISP_ADMIN_EMAIL=admin@admin.test +MISP_ADMIN_PASSPHRASE=admin +MISP_BASEURL=localhost + +POSTFIX_RELAY_HOST=relay.fqdn +TIMEZONE=Europe/Brussels + +DATA_DIR=./data \ No newline at end of file