mirror of
https://github.com/wazuh/wazuh-docker.git
synced 2025-11-04 22:13:23 +00:00
Setting wazuh-nginx image
This commit is contained in:
@@ -66,12 +66,10 @@ services:
|
|||||||
# environment:
|
# environment:
|
||||||
# - "WAZUH_KIBANA_PLUGIN_URL=http://your.repo/wazuhapp-2.1.0-5.5.1.zip"
|
# - "WAZUH_KIBANA_PLUGIN_URL=http://your.repo/wazuhapp-2.1.0-5.5.1.zip"
|
||||||
nginx:
|
nginx:
|
||||||
image: nginx:latest
|
image: wazuh/wazuh-nginx
|
||||||
hostname: nginx
|
hostname: nginx
|
||||||
restart: always
|
restart: always
|
||||||
command: bash /configure.sh
|
entrypoint: sh /configure.sh
|
||||||
volumes:
|
|
||||||
- ./nginx/configure.sh:/configure.sh
|
|
||||||
environment:
|
environment:
|
||||||
- NGINX_PORT=443
|
- NGINX_PORT=443
|
||||||
ports:
|
ports:
|
||||||
|
|||||||
5
nginx/Dockerfile
Normal file
5
nginx/Dockerfile
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
FROM nginx:latest
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get install -y openssl apache2-utils
|
||||||
|
|
||||||
|
COPY ./configure.sh /configure.sh
|
||||||
@@ -4,20 +4,14 @@ set -e
|
|||||||
|
|
||||||
if [ ! -d /etc/pki/tls/certs ]; then
|
if [ ! -d /etc/pki/tls/certs ]; then
|
||||||
echo "Generating SSL certificates"
|
echo "Generating SSL certificates"
|
||||||
if [ ! -x /usr/bin/openssl ]; then
|
|
||||||
apt-get update >/dev/null
|
|
||||||
apt-get -y install openssl >/dev/null
|
|
||||||
fi
|
|
||||||
mkdir -p /etc/pki/tls/certs /etc/pki/tls/private
|
mkdir -p /etc/pki/tls/certs /etc/pki/tls/private
|
||||||
openssl req -x509 -batch -nodes -days 365 -newkey rsa:2048 -keyout /etc/pki/tls/private/kibana-access.key -out /etc/pki/tls/certs/kibana-access.pem >/dev/null
|
openssl req -x509 -batch -nodes -days 365 -newkey rsa:2048 -keyout /etc/pki/tls/private/kibana-access.key -out /etc/pki/tls/certs/kibana-access.pem >/dev/null
|
||||||
|
else
|
||||||
|
echo "SSL certificates already present"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f /etc/nginx/conf.d/kibana.htpasswd ]; then
|
if [ ! -f /etc/nginx/conf.d/kibana.htpasswd ]; then
|
||||||
echo "Setting kibana credentials"
|
echo "Setting Nginx credentials"
|
||||||
if [ ! -x /usr/bin/htpasswd ]; then
|
|
||||||
apt-get update >/dev/null
|
|
||||||
apt-get -y install apache2-utils >/dev/null
|
|
||||||
fi
|
|
||||||
echo bar|htpasswd -i -c /etc/nginx/conf.d/kibana.htpasswd foo >/dev/null
|
echo bar|htpasswd -i -c /etc/nginx/conf.d/kibana.htpasswd foo >/dev/null
|
||||||
else
|
else
|
||||||
echo "Kibana credentials already configured"
|
echo "Kibana credentials already configured"
|
||||||
|
|||||||
Reference in New Issue
Block a user