Skip to content

Commit

Permalink
added couchdb
Browse files Browse the repository at this point in the history
  • Loading branch information
lombax85 committed Oct 15, 2016
1 parent 8646cc4 commit 917d12d
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .env.composer
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ MONGODB_PORT=27017
# php version: v7.0 use Dockerfile-70, v5.6 use Dockerfile-56
PHP_DOCKERFILE=Dockerfile-70

# couchdb
CONF_COUCHDB_USER=couch
CONF_COUCHDB_PASSWORD=secret
CONF_COUCHDB_PORT=5984

# php-fpm and workspace environment variables
INSTALL_XDEBUG=false
INSTALL_MONGO=false
Expand Down
5 changes: 5 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ MONGODB_PORT=27017
# php version: v7.0 use Dockerfile-70, v5.6 use Dockerfile-56
PHP_DOCKERFILE=Dockerfile-70

# couchdb
CONF_COUCHDB_USER=couch
CONF_COUCHDB_PASSWORD=secret
CONF_COUCHDB_PORT=5984

# php-fpm and workspace environment variables
INSTALL_XDEBUG=true
INSTALL_MONGO=true
Expand Down
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,19 @@ DESCRIPTION
-----------------------

This project demonstrates how to use docker-compose to split a sample php application into docker containers.
Each container runs a component: apache2, php-fpm, mysql, mongodb, and finally one container for data (binding project directory and data directories to the container itself), and one container for the workspace (a special container you can use to run CLI commands).
Each container runs a component: apache2, php-fpm, mysql, mongodb, couchdb and finally one container for data (binding project directory and data directories to the container itself), and one container for the workspace (a special container you can use to run CLI commands).
This project can be easily integrated into you existing webapp to permit you to deploy it faster on development machines, staging servers and production servers.

REQUIREMENTS
-----------------------
- docker-compose, min version 1.8
- docker, min version 1.10

If you want to install via composer:
- composer
- php, min version 5.6


INSTALL
-----------------------

Expand Down Expand Up @@ -75,8 +85,8 @@ START
- execute this command

```
docker-compose build apache2 mysql workspace mongo php-fpm
docker-compose up -d apache2 mysql mongo
docker-compose build apache2 mysql workspace mongo php-fpm couchdb
docker-compose up -d apache2 mysql mongo couchdb
```

- After these commands you'll have your containers up and running, use `docker ps` to see them
Expand Down
7 changes: 6 additions & 1 deletion TODO
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
- inserire nel readme i prerequisiti: docker, docker-compose, php e composer. Php e composer solo se si vuole installare via composer
- inserire le versioni minime di docker e docker-compose (compose mi pare almeno 1.6 ma verificare meglio)
- inserire un mini troubleshooting per problemi, es se porta duplicata
- inserire un mini troubleshooting per problemi, es se porta duplicata

Comandi couchdb di esempio:

curl -X GET http://127.0.0.1:5984/_all_dbs
curl -X PUT http://couch:[email protected]:5984/baseball
13 changes: 13 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,19 @@ services:
- "${MONGODB_PORT}:27017"
volumes_from:
- volumes_data

### CouchDB Container #######################################

couchdb:
build:
context: ./${DOCKER_DIRECTORY}/couchdb
args:
- CONF_COUCHDB_USER
- CONF_COUCHDB_PASSWORD
ports:
- "${CONF_COUCHDB_PORT}:5984"
volumes_from:
- volumes_data

### Memcached Container #####################################

Expand Down Expand Up @@ -146,6 +158,7 @@ services:
- ./${DOCKER_DATA_DIRECTORY}/memcached:/var/lib/memcached
- ./${DOCKER_DATA_DIRECTORY}/mongo:/data/db
- ./${DOCKER_DATA_DIRECTORY}/sessions:/sessions
- ./${DOCKER_DATA_DIRECTORY}/couchdb:/opt/couchdb/data
# - ./data/postgres:/var/lib/postgresql/data
# - ./data/redis:/data
# - ./data/neo4j:/var/lib/neo4j/data
Expand Down
13 changes: 13 additions & 0 deletions docker/couchdb/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM klaemo/couchdb:latest

ARG CONF_COUCHDB_USER=couchdb
ARG CONF_COUCHDB_PASSWORD=secret

ENV COUCHDB_USER=$CONF_COUCHDB_USER
ENV COUCHDB_PASSWORD=$CONF_COUCHDB_PASSWORD

EXPOSE 5984

WORKDIR /opt/couchdb/data


0 comments on commit 917d12d

Please sign in to comment.