Skip to content

Commit

Permalink
- refactoring to include all images, locally in the root directory
Browse files Browse the repository at this point in the history
- updated README
  • Loading branch information
doublebyte1 authored and Delawen committed Oct 31, 2016
1 parent ba8c339 commit 78364b2
Show file tree
Hide file tree
Showing 26 changed files with 29 additions and 392 deletions.
10 changes: 0 additions & 10 deletions docker/live_compose/README.md → docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,7 @@ After creating the containers, you can start the system at any time with:
```bash
docker-compose start
```
The current version of this system, uses a base image for the database, which is **not** available on the public Docker Hub repository. Before calling _docker-compose_, you need to **ensure that this image is built on your system**. You can build it manually with:

```bash
docker build -t live_db https://$gitlab_user:$gitlab_pass@eos.geocat.net/gitlab/live/live_db.git#master
```
For convenience, a script is provided, which will check if this image is present, and build it otherwise, before launching the compose. To build & run the system, type:

```bash
./run.sh
```
Data Container
--------------
As mentioned before, the _data volumes_ are dettached from the containers and mounted in a data container. This allows the service containers to be stopped, restarted or killed, without any loss of data.
Expand All @@ -88,7 +79,6 @@ Network and Security
--------------------
Docker creates an internal network, which is then used to communicate between containers. All containers are binded to the same host, which is _localhost_ on Linux and the address of the docker machine on OsX and Windows.
Only two ports are exposed outside this internal network: 80 and 443 on the apache container.
The data container exposes port 9102, which is used by the bacula-client to communicate with the server. If you want to take advantage of the backup funcionality, be sure to open this port in any firewall.

The PostgreSQL DB accepts passwordless local conections from _postgres_ user. It also accepts authenticated remote connections, but these are limited to the internal network, as we do not expose the PostgreSQL port.
Currently, we use a set of default username and passwords, which should be *changed* for increased security:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
version: '2'
services:

#TODO: export this environmental variables first: $gitlab_user:$gitlab_pass

gn:
build:
context: https://$gitlab_user:[email protected]/gitlab/live/live_gn.git#cobweb
build: ./live_gn
expose:
- "8009"
links:
Expand All @@ -15,8 +12,7 @@ services:
container_name: "geonetwork"

gs:
build:
context: https://$gitlab_user:[email protected]/gitlab/live/live_gs.git#cobweb
build: ./live_gs
expose:
- "8009"
links:
Expand All @@ -29,7 +25,6 @@ services:
build: ./live_db
volumes_from:
- data

data:
build: ./live_data
ports:
Expand Down
File renamed without changes
26 changes: 0 additions & 26 deletions docker/live_compose/live_db/Dockerfile

This file was deleted.

30 changes: 0 additions & 30 deletions docker/live_compose/run.sh

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
26 changes: 26 additions & 0 deletions docker/live_db/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,29 @@ COPY ./pg_hba.conf /etc/postgresql/9.3/main/pg_hba.conf

# And add ``listen_addresses`` to ``/etc/postgresql/9.3/main/postgresql.conf``
RUN echo "listen_addresses='*'" >> /etc/postgresql/9.3/main/postgresql.conf

#Workaround to overcome this issue https://github.com/docker/docker/issues/783#issuecomment-56013588
RUN mkdir /etc/ssl/private-copy; mv /etc/ssl/private/* /etc/ssl/private-copy/; \
rm -r /etc/ssl/private; mv /etc/ssl/private-copy /etc/ssl/private; \
chmod -R 0700 /etc/ssl/private; chown -R postgres /etc/ssl/private;

RUN chown -R postgres /var/lib/postgresql/9.3/main

USER postgres

RUN /etc/init.d/postgresql start &&\
psql --command "CREATE USER admin WITH SUPERUSER PASSWORD 'gnos';" &&\
psql --command "CREATE USER geoserver WITH SUPERUSER PASSWORD 'geoserver';" && \
createdb -O admin geonetwork-private &&\
createdb -O geoserver geoserver &&\
createdb -O admin admin &&\
psql --dbname=admin --command "create extension pg_stat_statements;" &&\
psql --dbname=geoserver --command "create extension pg_stat_statements;" &&\
psql --dbname=geonetwork-private --command "create extension pg_stat_statements;" &&\
psql --dbname=geoserver --command "CREATE EXTENSION postgis;" &&\
psql --dbname=geoserver --command "CREATE EXTENSION postgis_topology;" &&\
psql --dbname=geonetwork-private --command "CREATE EXTENSION postgis;" &&\
psql --dbname=geonetwork-private --command "CREATE EXTENSION postgis_topology;"

CMD ["/usr/lib/postgresql/9.3/bin/postgres", "-D", "/var/lib/postgresql/9.3/main", "-c", "config_file=/etc/postgresql/9.3/main/postgresql.conf"]

105 changes: 0 additions & 105 deletions docker/live_db/README.md

This file was deleted.

Binary file removed docker/live_db/heckert_gnu.small.png
Binary file not shown.
Binary file removed docker/live_db/postgres.png
Binary file not shown.
2 changes: 1 addition & 1 deletion docker/live_gn/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ WORKDIR /usr/local/tomcat/
WORKDIR /usr/local/tomcat/webapps

RUN wget -O geonetwork-cobweb.war \
https://eos.geocat.net/gitlab/joana.simoes/cobweb-gn/raw/master/geonetwork-cobweb.war
https://github.com/doublebyte1/cobweb-gn/raw/master/geonetwork-cobweb.war
RUN echo "$GN_DOWNLOAD_MD5 *geonetwork-cobweb.war" | md5sum -c

RUN mkdir -p /usr/local/tomcat/webapps/geonetwork && \
Expand Down
114 changes: 0 additions & 114 deletions docker/live_gn/README.md

This file was deleted.

Binary file removed docker/live_gn/gn-docker.png
Binary file not shown.
Binary file removed docker/live_gn/heckert_gnu.small.png
Binary file not shown.
Loading

0 comments on commit 78364b2

Please sign in to comment.