-
Notifications
You must be signed in to change notification settings - Fork 445
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CE-182] Refactor docker-compose and Dockerfile
Currently docker-compose*yml files and Dockerfiles are strictly architecture x86_64 dependent. To make it architecture independent, [CE-170] was introduced. This PR leverages [CE-170] and restructures docker-compose*yml and Dockerfiles and makes it architecture independent. Change-Id: I30faf25797263dcc8ee65f61277a9bfab3000a96 Signed-off-by: Krishna Harsha Voora <krishvoor@in.ibm.com>
- Loading branch information
Showing
15 changed files
with
119 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
FROM _NS_/cello-baseimage:_TAG_ | ||
|
||
COPY nginx/ /tmp/ | ||
|
||
RUN cp /tmp/nginx.default.conf /etc/nginx/nginx.default.conf | ||
|
||
RUN ln -sf /dev/stdout /var/log/nginx/access.log \ | ||
&& ln -sf /dev/stderr /var/log/nginx/error.log | ||
|
||
EXPOSE 80 443 | ||
|
||
CMD ["nginx", "-g", "daemon off;"] | ||
CMD ["/bin/bash", "/tmp/docker-entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
# | ||
# Copyright IBM Corp. All Rights Reserved. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# Based this file on https://github.com/yeasy/docker-nginx/blob/master/docker-entrypoint.sh | ||
|
||
set -e | ||
backend="${BACKEND:-localhost}" | ||
port="${PORT:-80}" | ||
username="${USERNAME:-user}" | ||
password="${PASSWORD:-pass}" | ||
|
||
htpasswd -c -b /etc/nginx/.htpasswd "$username" "$password" | ||
|
||
sed "s/BACKEND/$backend/; s/PORT/$port/" /etc/nginx/nginx.default.conf > /etc/nginx/nginx.conf | ||
|
||
nginx -c /etc/nginx/nginx.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# This file should be put under /etc/nginx/conf.d/ | ||
# Or place as /etc/nginx/nginx.conf | ||
|
||
user nginx; | ||
worker_processes auto; | ||
daemon off; | ||
|
||
error_log /var/log/nginx/error.log warn; | ||
pid /var/run/nginx.pid; | ||
|
||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
http { | ||
include /etc/nginx/mime.types; | ||
default_type application/octet-stream; | ||
|
||
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; | ||
|
||
server_tokens off; | ||
|
||
sendfile on; | ||
tcp_nopush on; | ||
|
||
keepalive_timeout 60; | ||
tcp_nodelay on; | ||
client_body_timeout 15; | ||
|
||
gzip on; | ||
gzip_vary on; | ||
gzip_min_length 1k; | ||
|
||
upstream backend { | ||
server BACKEND:PORT; | ||
} | ||
|
||
server { | ||
listen 80; | ||
|
||
location / { | ||
if ($request_method !~ ^(GET|DELETE|POST|PUT)$ ) { | ||
return 444; | ||
} | ||
auth_basic "Login"; | ||
auth_basic_user_file /etc/nginx/.htpasswd; | ||
proxy_pass http://backend; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Forwarded-For $remote_addr; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
} | ||
|
||
error_page 500 502 503 504 /50x.html; | ||
location = /50x.html { | ||
root html; | ||
} | ||
} | ||
|
||
include /etc/nginx/conf.d/*.conf; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters