Add docker tests
Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
This commit is contained in:
parent
bb1d535e5f
commit
91e0148f87
4 changed files with 129 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -0,0 +1 @@
|
|||
*.py[oc]
|
||||
23
Dockerfile
Normal file
23
Dockerfile
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
FROM asamalik/module-nginx-master
|
||||
|
||||
# Labels
|
||||
LABEL name="nginx" \
|
||||
summary="Nginx is a web server." \
|
||||
description="Nginx is a web server, which can also be used as a reverse proxy, load balancer and HTTP cache." \
|
||||
version="0" \
|
||||
release="1" \
|
||||
atomic.has_install_files="true"
|
||||
|
||||
# Add neccessary configuration files
|
||||
COPY files/nginx.conf /etc/nginx/nginx.conf
|
||||
COPY files/service.template /exports/hostfs/usr/lib/systemd/system/nginx-container.service
|
||||
|
||||
RUN mkdir -p /exports/hostfs/{usr/share,etc} && \
|
||||
cp -ar /usr/share/nginx /exports/hostfs/usr/share/ && \
|
||||
cp -ar /etc/nginx /exports/hostfs/etc
|
||||
|
||||
# Export port for nginx frontend
|
||||
EXPOSE 80
|
||||
|
||||
# Start nginx
|
||||
CMD ["/usr/sbin/nginx"]
|
||||
94
files/nginx.conf
Normal file
94
files/nginx.conf
Normal file
|
|
@ -0,0 +1,94 @@
|
|||
# For more information on configuration, see:
|
||||
# * Official English Documentation: http://nginx.org/en/docs/
|
||||
# * Official Russian Documentation: http://nginx.org/ru/docs/
|
||||
|
||||
user nginx;
|
||||
worker_processes auto;
|
||||
pid /run/nginx.pid;
|
||||
|
||||
# Keep these settings to ensure the container runs correctly
|
||||
error_log stderr;
|
||||
daemon off;
|
||||
|
||||
# Load dynamic modules. See /usr/share/nginx/README.dynamic.
|
||||
include /usr/share/nginx/modules/*.conf;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||
'$status $body_bytes_sent "$http_referer" '
|
||||
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||
|
||||
access_log /var/log/nginx/access.log main;
|
||||
|
||||
sendfile on;
|
||||
tcp_nopush on;
|
||||
tcp_nodelay on;
|
||||
keepalive_timeout 65;
|
||||
types_hash_max_size 4096;
|
||||
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
# Load modular configuration files from the /etc/nginx/conf.d directory.
|
||||
# See http://nginx.org/en/docs/ngx_core_module.html#include
|
||||
# for more information.
|
||||
include /etc/nginx/conf.d/*.conf;
|
||||
|
||||
server {
|
||||
listen 80 default_server;
|
||||
listen [::]:80 default_server;
|
||||
server_name _;
|
||||
root /usr/share/nginx/html;
|
||||
|
||||
# Load configuration files for the default server block.
|
||||
include /etc/nginx/default.d/*.conf;
|
||||
|
||||
location / {
|
||||
|
||||
}
|
||||
|
||||
error_page 404 /404.html;
|
||||
location = /40x.html {
|
||||
}
|
||||
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
location = /50x.html {
|
||||
}
|
||||
}
|
||||
|
||||
# Settings for a TLS enabled server.
|
||||
#
|
||||
# server {
|
||||
# listen 443 ssl http2 default_server;
|
||||
# listen [::]:443 ssl http2 default_server;
|
||||
# server_name _;
|
||||
# root /usr/share/nginx/html;
|
||||
#
|
||||
# ssl_certificate "/etc/pki/nginx/server.crt";
|
||||
# ssl_certificate_key "/etc/pki/nginx/private/server.key";
|
||||
# ssl_session_cache shared:SSL:1m;
|
||||
# ssl_session_timeout 10m;
|
||||
# ssl_ciphers HIGH:!aNULL:!MD5;
|
||||
# ssl_prefer_server_ciphers on;
|
||||
#
|
||||
# # Load configuration files for the default server block.
|
||||
# include /etc/nginx/default.d/*.conf;
|
||||
#
|
||||
# location / {
|
||||
# }
|
||||
#
|
||||
# error_page 404 /404.html;
|
||||
# location = /40x.html {
|
||||
# }
|
||||
#
|
||||
# error_page 500 502 503 504 /50x.html;
|
||||
# location = /50x.html {
|
||||
# }
|
||||
# }
|
||||
|
||||
}
|
||||
|
||||
11
files/service.template
Normal file
11
files/service.template
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
[Unit]
|
||||
Description="Standalone container version of NGINX webserver."
|
||||
|
||||
[Service]
|
||||
ExecStartPre=/usr/bin/docker create -t -i -v /etc/nginx:/etc/nginx/:ro --net=host -v /usr/share/nginx:/usr/share/nginx/:ro --name nginx-container modularitycontainers/nginx
|
||||
ExecStart=/usr/bin/docker start -a nginx-container
|
||||
ExecStop=/usr/bin/docker stop nginx-container
|
||||
ExecStopPost=/usr/bin/docker rm -f nginx-container
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Loading…
Add table
Add a link
Reference in a new issue