more commits
This commit is contained in:
parent
089bcf590c
commit
3615c96614
34
ckan/Dockerfile.dev
Normal file
34
ckan/Dockerfile.dev
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
FROM ckan/ckan-base:2.9.5-dev
|
||||||
|
|
||||||
|
|
||||||
|
# Set up environment variables
|
||||||
|
ENV APP_DIR=/srv/app
|
||||||
|
ENV TZ=UTC
|
||||||
|
RUN echo ${TZ} > /etc/timezone
|
||||||
|
|
||||||
|
# Make sure both files are not exactly the same
|
||||||
|
RUN if ! [ /usr/share/zoneinfo/${TZ} -ef /etc/localtime ]; then \
|
||||||
|
cp /usr/share/zoneinfo/${TZ} /etc/localtime ;\
|
||||||
|
fi ;
|
||||||
|
|
||||||
|
# Install any extensions needed by your CKAN instance
|
||||||
|
# (Make sure to add the plugins to CKAN__PLUGINS in the .env file)
|
||||||
|
# For instance:
|
||||||
|
#RUN pip install -e git+https://github.com/ckan/ckanext-pages.git#egg=ckanext-pages && \
|
||||||
|
# pip install -e git+https://github.com/ckan/ckanext-dcat.git@v0.0.6#egg=ckanext-dcat && \
|
||||||
|
# pip install -r https://raw.githubusercontent.com/ckan/ckanext-dcat/v0.0.6/requirements.txt
|
||||||
|
|
||||||
|
# Clone the extension(s) your are writing for your own project in the `src` folder
|
||||||
|
# to get them mounted in this image at runtime
|
||||||
|
|
||||||
|
# Apply any patches needed to CKAN core or any of the built extensions (not the
|
||||||
|
# runtime mounted ones)
|
||||||
|
COPY patches ${APP_DIR}/patches
|
||||||
|
|
||||||
|
RUN for d in $APP_DIR/patches/*; do \
|
||||||
|
if [ -d $d ]; then \
|
||||||
|
for f in `ls $d/*.patch | sort -g`; do \
|
||||||
|
cd $SRC_DIR/`basename "$d"` && echo "$0: Applying patch $f to $SRC_DIR/`basename $d`"; patch -p1 < "$f" ; \
|
||||||
|
done ; \
|
||||||
|
fi ; \
|
||||||
|
done
|
||||||
@ -1,7 +1,16 @@
|
|||||||
version: "3"
|
version: "3"
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
ckan_config:
|
||||||
|
ckan_home:
|
||||||
|
ckan_storage:
|
||||||
|
pg_data:
|
||||||
|
solr_data:
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
|
||||||
ckan-dev:
|
ckan-dev:
|
||||||
|
container_name: ${CKAN_CONTAINER_NAME}
|
||||||
build:
|
build:
|
||||||
context: ckan/
|
context: ckan/
|
||||||
dockerfile: Dockerfile.dev
|
dockerfile: Dockerfile.dev
|
||||||
@ -9,47 +18,63 @@ services:
|
|||||||
- TZ=${TZ}
|
- TZ=${TZ}
|
||||||
env_file:
|
env_file:
|
||||||
- .env
|
- .env
|
||||||
links:
|
depends_on:
|
||||||
- db
|
db:
|
||||||
- solr
|
condition: service_healthy
|
||||||
- redis
|
solr:
|
||||||
- datapusher
|
condition: service_healthy
|
||||||
|
redis:
|
||||||
|
condition: service_healthy
|
||||||
ports:
|
ports:
|
||||||
- "0.0.0.0:${CKAN_PORT}:5000"
|
- "0.0.0.0:${CKAN_PORT}:5000"
|
||||||
volumes:
|
volumes:
|
||||||
- ./src:/srv/app/src_extensions
|
- ckan_config:/etc/ckan
|
||||||
|
- ckan_home:/usr/lib/ckan
|
||||||
- ckan_storage:/var/lib/ckan
|
- ckan_storage:/var/lib/ckan
|
||||||
|
- ./src:/srv/app/src_extensions
|
||||||
|
restart: unless-stopped
|
||||||
|
#healthcheck:
|
||||||
|
# test: ["CMD", "wget", "-qO", "/dev/null", "http://localhost:5000"]
|
||||||
|
|
||||||
|
|
||||||
datapusher:
|
datapusher:
|
||||||
container_name: datapusher
|
container_name: ${DATAPUSHER_CONTAINER_NAME}
|
||||||
image: kowhai/datapusher:0.0.17
|
build:
|
||||||
|
context: datapusher/
|
||||||
|
args:
|
||||||
|
- DATAPUSHER_VERSION=${DATAPUSHER_VERSION}
|
||||||
ports:
|
ports:
|
||||||
- "8800:8800"
|
- "8800:8800"
|
||||||
|
restart: unless-stopped
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "wget", "-qO", "/dev/null", "http://localhost:8800"]
|
||||||
|
|
||||||
db:
|
db:
|
||||||
container_name: db
|
container_name: ${POSTGRESQL_CONTAINER_NAME}
|
||||||
env_file:
|
|
||||||
- .env
|
|
||||||
build:
|
build:
|
||||||
context: postgresql/
|
context: postgresql/
|
||||||
|
args:
|
||||||
|
- DATASTORE_READONLY_PASSWORD=${DATASTORE_READONLY_PASSWORD}
|
||||||
|
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
||||||
|
environment:
|
||||||
|
- DATASTORE_READONLY_PASSWORD=${DATASTORE_READONLY_PASSWORD}
|
||||||
|
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
||||||
|
- PGDATA=/var/lib/postgresql/data/db
|
||||||
volumes:
|
volumes:
|
||||||
- pg_data:/var/lib/postgresql/data
|
- pg_data:/var/lib/postgresql/data
|
||||||
|
restart: unless-stopped
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "pg_isready", "-U", "ckan"]
|
||||||
|
|
||||||
solr:
|
solr:
|
||||||
container_name: solr
|
container_name: ${SOLR_CONTAINER_NAME}
|
||||||
build:
|
image: ckan/ckan-solr:${SOLR_IMAGE_VERSION}
|
||||||
context: solr/
|
restart: unless-stopped
|
||||||
ports:
|
healthcheck:
|
||||||
- "8983:8983"
|
test: ["CMD", "wget", "-qO", "/dev/null", "http://localhost:8983/solr/"]
|
||||||
volumes:
|
|
||||||
- solr_data:/opt/solr/server/solr/ckan/data/index
|
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
container_name: redis
|
container_name: ${REDIS_CONTAINER_NAME}
|
||||||
image: redis:alpine
|
image: redis:${REDIS_VERSION}
|
||||||
|
restart: unless-stopped
|
||||||
volumes:
|
healthcheck:
|
||||||
ckan_storage:
|
test: ["CMD", "redis-cli", "-e", "QUIT"]
|
||||||
pg_data:
|
|
||||||
solr_data:
|
|
||||||
@ -14,8 +14,9 @@ services:
|
|||||||
build:
|
build:
|
||||||
context: nginx/
|
context: nginx/
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
#links:
|
#depends_on:
|
||||||
# - ckan
|
# ckan:
|
||||||
|
# condition: service_healthy
|
||||||
ports:
|
ports:
|
||||||
- "0.0.0.0:81:80"
|
- "0.0.0.0:81:80"
|
||||||
|
|
||||||
|
|||||||
@ -2,12 +2,7 @@ FROM nginx:stable-alpine
|
|||||||
|
|
||||||
ENV NGINX_DIR=/etc/nginx
|
ENV NGINX_DIR=/etc/nginx
|
||||||
|
|
||||||
RUN mkdir -p ${NGINX_DIR}/sites-available
|
|
||||||
RUN mkdir -p ${NGINX_DIR}/sites-enabled
|
|
||||||
|
|
||||||
COPY setup/index.html /usr/share/nginx/html/index.html
|
COPY setup/index.html /usr/share/nginx/html/index.html
|
||||||
COPY setup/sites-available/* ${NGINX_DIR}/sites-available
|
COPY setup/*.conf ${NGINX_DIR}/conf.d/
|
||||||
|
|
||||||
RUN ln -s ${NGINX_DIR}/sites-available/ckan.conf ${NGINX_DIR}/sites-enabled/ckan.conf
|
|
||||||
|
|
||||||
EXPOSE 81
|
EXPOSE 81
|
||||||
28
nginx/setup/default.conf
Normal file
28
nginx/setup/default.conf
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
listen [::]:80;
|
||||||
|
server_name localhost;
|
||||||
|
|
||||||
|
#access_log /var/log/nginx/host.access.log main;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
proxy_pass http://ckan:5000/;
|
||||||
|
proxy_set_header X-Forwarded-For $remote_addr;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
#proxy_cache cache;
|
||||||
|
proxy_cache_bypass $cookie_auth_tkt;
|
||||||
|
proxy_no_cache $cookie_auth_tkt;
|
||||||
|
proxy_cache_valid 30m;
|
||||||
|
proxy_cache_key $host$scheme$proxy_host$request_uri;
|
||||||
|
}
|
||||||
|
|
||||||
|
error_page 404 /404.html;
|
||||||
|
|
||||||
|
# redirect server error pages to the static page /50x.html
|
||||||
|
#
|
||||||
|
error_page 500 502 503 504 /50x.html;
|
||||||
|
location = /50x.html {
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,18 +0,0 @@
|
|||||||
proxy_cache_path /tmp/nginx_cache levels=1:2 keys_zone=cache:30m max_size=250m;
|
|
||||||
proxy_temp_path /tmp/nginx_proxy 1 2;
|
|
||||||
|
|
||||||
server {
|
|
||||||
client_max_body_size 100M;
|
|
||||||
location / {
|
|
||||||
#proxy_pass http://ckan:5000/;
|
|
||||||
proxy_set_header X-Forwarded-For $remote_addr;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_cache cache;
|
|
||||||
proxy_cache_bypass $cookie_auth_tkt;
|
|
||||||
proxy_no_cache $cookie_auth_tkt;
|
|
||||||
proxy_cache_valid 30m;
|
|
||||||
proxy_cache_key $host$scheme$proxy_host$request_uri;
|
|
||||||
# In emergency comment out line to force caching
|
|
||||||
# proxy_ignore_headers X-Accel-Expires Expires Cache-Control;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
x
Reference in New Issue
Block a user