diff --git a/TODO's.txt b/TODO's.txt index a76276c..a435e33 100644 --- a/TODO's.txt +++ b/TODO's.txt @@ -24,9 +24,8 @@ NB: Had to update the prerun.py script as it was failing on check_solr_connecti ### ToDo (remaining things to think about and/or 'to fix') ### -1. nginx - what caching should I implement? -2. DataPusher - needed to use a custom requirements.txt as the official didn't work (see https://github.com/ckan/datapusher/pull/251) -3. Use Multi-Stage images defined in Dockerfile - get the CKAN images down to bare-bones...for security reasons really +1. DataPusher - needed to use a custom requirements.txt as the official didn't work (see https://github.com/ckan/datapusher/pull/251) +2. Use Multi-Stage images defined in Dockerfile - get the CKAN images down to bare-bones...for security reasons really General Dockerfile flow of stages: - base: all prod dependencies, no code yet - dev, from base: all dev dependencies, no code yet (in dev, source code is bind-mounted anyway) @@ -34,5 +33,5 @@ NB: Had to update the prerun.py script as it was failing on check_solr_connecti - test/audit, from source: then COPY --from=dev for dev dependencies, then run tests. Optionally, audit and lint code (if you don't do it on git push already). - prod, from source: no change from source stage, but listed last so in case a stage isn't targeted, the builder will default to this stage Also check out https://github.com/ckan/ckan/pull/4635 for Francesco's test stuff -4. CKAN Worker (maybe) -5. Implement SSL for the nginx container or include a howto in the docs \ No newline at end of file +3. CKAN Worker (maybe) +4. Implement SSL for the nginx container or include a howto in the docs \ No newline at end of file diff --git a/nginx/Dockerfile b/nginx/Dockerfile index 6d9d37f..d9bfe10 100644 --- a/nginx/Dockerfile +++ b/nginx/Dockerfile @@ -2,9 +2,8 @@ FROM nginx:stable-alpine ENV NGINX_DIR=/etc/nginx +COPY setup/nginx.conf ${NGINX_DIR}/nginx.conf COPY setup/index.html /usr/share/nginx/html/index.html -COPY setup/*.conf ${NGINX_DIR}/conf.d/ - -#RUN mkdir -p /tmp/nginx/cache +COPY setup/default.conf ${NGINX_DIR}/conf.d/ EXPOSE 81 \ No newline at end of file diff --git a/nginx/setup/nginx.conf b/nginx/setup/nginx.conf new file mode 100644 index 0000000..b14c5be --- /dev/null +++ b/nginx/setup/nginx.conf @@ -0,0 +1,35 @@ + +user nginx; +worker_processes auto; + +error_log /var/log/nginx/error.log notice; +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; + + sendfile on; + #tcp_nopush on; + + keepalive_timeout 65; + + #gzip on; + + proxy_cache_path /tmp/nginx_cache levels=1:2 keys_zone=cache:30m max_size=250m; + proxy_temp_path /tmp/nginx_proxy 1 2; + + include /etc/nginx/conf.d/*.conf; +} \ No newline at end of file