mirror of
https://github.com/wazuh/wazuh-docker.git
synced 2025-10-30 19:43:30 +00:00
Setting wazuh-nginx image
This commit is contained in:
@@ -66,12 +66,10 @@ services:
|
||||
# environment:
|
||||
# - "WAZUH_KIBANA_PLUGIN_URL=http://your.repo/wazuhapp-2.1.0-5.5.1.zip"
|
||||
nginx:
|
||||
image: nginx:latest
|
||||
image: wazuh/wazuh-nginx
|
||||
hostname: nginx
|
||||
restart: always
|
||||
command: bash /configure.sh
|
||||
volumes:
|
||||
- ./nginx/configure.sh:/configure.sh
|
||||
entrypoint: sh /configure.sh
|
||||
environment:
|
||||
- NGINX_PORT=443
|
||||
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
|
||||
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
|
||||
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
|
||||
|
||||
if [ ! -f /etc/nginx/conf.d/kibana.htpasswd ]; then
|
||||
echo "Setting kibana credentials"
|
||||
if [ ! -x /usr/bin/htpasswd ]; then
|
||||
apt-get update >/dev/null
|
||||
apt-get -y install apache2-utils >/dev/null
|
||||
fi
|
||||
echo "Setting Nginx credentials"
|
||||
echo bar|htpasswd -i -c /etc/nginx/conf.d/kibana.htpasswd foo >/dev/null
|
||||
else
|
||||
echo "Kibana credentials already configured"
|
||||
|
||||
Reference in New Issue
Block a user