Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small tweaks in Docker #323

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,5 @@ target/

# CONFIG
config/dev.ini
Docker/.env
Docker/apache2/.htpasswd
6 changes: 5 additions & 1 deletion Docker/apache2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ RUN apt-get update && \
unzip \
gettext-base \
git \
curl \
php-gd php-apcu php-mysqli php-memcached php-memcache php-xml php-soap php-zip \
php-cli php-common php-bcmath php-curl php-gd php-geoip \
php-imagick php-intl php-json php-msgpack php-mcrypt php-mysql \
Expand All @@ -18,6 +19,10 @@ RUN apt-get update && \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean -y

# Download Piwik (as early as possible for avoid cache bursting)

RUN curl -s http://builds.piwik.org/piwik.zip -o /var/www/html/piwik.zip


# Enable apache2 modules

Expand All @@ -42,7 +47,6 @@ COPY memcache.ini /etc/php//mods-available/memcache.ini

# Install piwik

ADD http://builds.piwik.org/piwik.zip /var/www/html/
RUN cd /var/www/html/ && unzip piwik.zip && \
cd /var/www/html/ && rm piwik.zip && \
chown -R www-data: /var/www/html/
Expand Down
6 changes: 4 additions & 2 deletions Docker/ckan-base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ RUN apt-get -q -y update && apt-get -q -y upgrade && DEBIAN_FRONTEND=noninteract
python-pip \
python-virtualenv \
libpq-dev \
python-virtualenv \
python-wheel \
git-core \
build-essential \
libssl-dev \
Expand All @@ -28,7 +30,7 @@ RUN ln -s $CKAN_HOME/bin/pip /usr/local/bin/ckan-pip
RUN ln -s $CKAN_HOME/bin/paster /usr/local/bin/ckan-paster

### DANE Z FORKA CKANA
RUN git clone https://github.com/DanePubliczneGovPl/ckan /tmp/ckan
RUN git clone --depth=50 https://github.com/DanePubliczneGovPl/ckan /tmp/ckan
RUN mkdir -p $CKAN_HOME/src/ckan/ && cp -r /tmp/ckan/. $CKAN_HOME/src/ckan/ && rm -fr /tmp/ckan/

# SetUp Requirements
Expand All @@ -54,4 +56,4 @@ ENTRYPOINT ["/ckan-entrypoint.sh"]
VOLUME ["/etc/ckan/default"]
VOLUME ["/var/lib/ckan"]
EXPOSE 5000
CMD ["ckan-paster","serve","/etc/ckan/default/ckan.ini"]
CMD ["ckan-paster","serve","/etc/ckan/default/ckan.ini"]
2 changes: 1 addition & 1 deletion Docker/ckan/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ RUN mkdir -p /home/ckan
RUN DEBIAN_FRONTEND=noninteractive apt-get update

# Install additional packages
RUN DEBIAN_FRONTEND=noninteractive apt-get install -q -y git wget curl libxml2-dev libxslt1-dev python-dev libffi-dev libjpeg-dev cron supervisor gettext-base \
RUN DEBIAN_FRONTEND=noninteractive apt-get install -q -y git wget curl libxml2-dev libxslt1-dev python-dev libffi-dev libjpeg-dev postgresql-client cron supervisor gettext-base \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean -y

Expand Down
11 changes: 2 additions & 9 deletions Docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
version: '2'
services:


# ckan-base:
# build: ckan-base/
# image: ckan-base

ckan:
#build: ckan/
image: ckan-epf
build: ckan/
container_name: ckan
depends_on:
- datapusher
Expand Down Expand Up @@ -73,7 +67,6 @@ services:
container_name: solr-ckan
restart: always


mysql:
image: mariadb:latest
container_name: mysql
Expand All @@ -89,7 +82,7 @@ services:
- MYSQL_USER=piwik
- MYSQL_PASSWORD=piwik

#najkrotszy serwis ever :)

redis:
image: redis

Expand Down
42 changes: 25 additions & 17 deletions Docker/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ Dokument w trakce tworzenia. Wersja 0.1

- [CKAN STACK - dokumentacja](#ckan-stack-dokumentacja)
- [1. Opis obrazów](#1-opis-obrazów)
- [2. Start stacka](#1-start-stacka)
- [2.1 katalog i źródła](#11-katalog-i-źródła)
- [2.2 Plik z konfiguracją](#12-plik-z-konfiguracją)
- [2.3 Budowa obrazu](#13-budowa-obrazu)
- [2.4 Uruchomienie stacka](#14-uruchomienie-stacka)
- [2.5 Werfyikacja stanu kontenerów](#15-werfyikacja-stanu-kontenerów)
- [2. Start stacka](#2-start-stacka)
- [2.1 katalog i źródła](#21-katalog-i-źródła)
- [2.2 Plik z konfiguracją](#22-plik-z-konfiguracją)
- [2.3 Ustalenie hasła](#23-ustalenie-has_a)
- [2.4 Budowa obrazu](#24-budowa-obrazu)
- [2.5 Uruchomienie stacka](#25-uruchomienie-stacka)
- [2.6 Werfyikacja stanu kontenerów](#26-werfyikacja-stanu-kontenerów)

<!-- /TOC -->

Expand All @@ -36,7 +37,7 @@ Poniższy opis pokazuje pierwsze uruchomienie stacka. Zakładam, że masz dostę
#### 2.1 katalog i źródła

Zakładasz katalog i pobierasz źródła
```
```bash
mkdir /home/ckan
cd /home/ckan && git clone [email protected]:DanePubliczneGovPl/ckanext-danepubliczne.git ckan
```
Expand All @@ -45,7 +46,7 @@ cd /home/ckan && git clone [email protected]:DanePubliczneGovPl/ckanext-danepublicz

Tworzysz plik /home/ckan/ckan/Docker/.env z konfiguracją stacka

```
```dotenv

#### SETUP ####
###############
Expand All @@ -63,8 +64,8 @@ PUBLIC_IP=192.168.50.22

# sciezki do certyfikatów

CERT_KEY=/etc/ssl/certs/mysitename.key
CERT_FILE=/etc/ssl/certs/mysitename.crt
CERT_FILE=/etc/ssl/private/ssl-cert-snakeoil.key
CERT_KEY=/etc/ssl/certs/ssl-cert-snakeoil.pem

# domena pod którą będzie działa strona

Expand All @@ -84,21 +85,28 @@ PIWIK_TRUSTED_HOSTS=stats.dp.gov.pl

# certyfikaty dla domeny piwika

CERT_FILE_STATS=/etc/ssl/certs/mysitename.key
CERT_KEY_STATS=/etc/ssl/certs/mysitename.crt
CERT_KEY_STATS=/etc/ssl/private/ssl-cert-snakeoil.key
CERT_FILE_STATS=/etc/ssl/certs/ssl-cert-snakeoil.pem
```
#### 2.3 Budowa obrazu
#### 2.3 Ustalenie hasła

Wykonujesz:
```bash
htpasswd -c -b apache2/.htpasswd ckan ckan
```

#### 2.4 Budowa obrazu
```
cd /home/ckan/ckan/Docker && docker-compose build
cd /home/ckan/ckan/Docker && docker build ckan-base/ -t ckan-base && docker -docker-compose build
```
#### 2.4 Uruchomienie stacka
#### 2.5 Uruchomienie stacka
```
cd /home/ckan/ckan/Docker && docker-compose up -d
```
#### 2.5 Werfyikacja stanu kontenerów
#### 2.6 Werfyikacja stanu kontenerów
```
cd /home/ckan/ckan/Docker && docker-compose ps
```


### FAQ
### FAQ