diff --git a/README.md b/README.md index a32be60..b2f0488 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ You can use NoDock for simple projects by using one of the [examples](#Examples) ## Requirements -* [Docker Engine 1.12+](https://docs.docker.com/engine/installation/) +* [Docker Engine 17.06+](https://docs.docker.com/engine/installation/) * [Docker Compose 1.8+](https://docs.docker.com/compose/install/) @@ -176,7 +176,15 @@ To add more node containers, simply add the following to your `docker-compose.ov # docker-compose.override.yml [...] node2: # name of new container - extends: node # extends the settings from the "node" container + build: # reuse the same values from the node service, cannot use extends in docker-compose 3+ + context: ./node + args: + - NODE_VERSION=latest + - PROJECT_PATH=/opt/app/ + - NODE_ENV=production + - YARN=false + volumes: + - ../:/opt/app entrypoint: run-nodock "node alternate.js" # the entrypoint for the "node2" container nginx: ports: diff --git a/_examples/2-nodes/README.md b/_examples/2-nodes/README.md index 3a0a25e..1c44339 100644 --- a/_examples/2-nodes/README.md +++ b/_examples/2-nodes/README.md @@ -7,7 +7,7 @@ Copy all the files in this folder to the project root: ```bash cd / -cp -r nodock/_examples/multiple-node/* . +cp -r nodock/_examples/2-nodes/* . mv docker-compose.override.yml nodock/ mv node2.conf nodock/nginx/sites/ ``` @@ -20,4 +20,4 @@ cd nodock/ docker-compose up -d node node2 nginx ``` -By going to `127.0.0.1` in your browser you should be seeing a nice greeting! By going to `127.0.0.1:10000` in your browser you should be seeing _another_ nice greeting! \ No newline at end of file +By going to `127.0.0.1` in your browser you should be seeing a nice greeting! By going to `127.0.0.1:10000` in your browser you should be seeing _another_ nice greeting! diff --git a/_examples/2-nodes/docker-compose.override.yml b/_examples/2-nodes/docker-compose.override.yml index 2d8eb22..2891214 100644 --- a/_examples/2-nodes/docker-compose.override.yml +++ b/_examples/2-nodes/docker-compose.override.yml @@ -1,17 +1,22 @@ # docker-compose.override.yml -version: '2' +version: '3.3' services: node2: # name of new container - extends: node # extends the settings from the "node" container build: context: ./node args: + - NODE_VERSION=latest - PROJECT_PATH=second-app + - NODE_ENV=production + - YARN=false + volumes: + - ../:/opt/app entrypoint: run-nodock "node index.js" # the entrypoint for the "node2" container + nginx: ports: - "10000:10000" # the port(s) to forward for the "node2" container links: - - node2 # link "nginx" to "node2" \ No newline at end of file + - node2 # link "nginx" to "node2" diff --git a/_examples/rabbitmq/README.md b/_examples/rabbitmq/README.md deleted file mode 100644 index e4474eb..0000000 --- a/_examples/rabbitmq/README.md +++ /dev/null @@ -1,21 +0,0 @@ -## RabbitMQ Service - -### Setup - -Copy the index file in this folder to the project root: - -```bash -cd / - -cp -r nodock/_examples/rabbitmq/* . -``` - -### Usage - -```bash -cd nodock/ - -docker-compose up -d rabbitmq node nginx -``` - -By going to `127.0.0.1` in your browser you should be seeing a message indicating that `node` has successfully connected to `rabbitmq`. If you are seeing an error message, wait a few seconds for RabbitMQ to spin up and reload the page. diff --git a/_examples/rabbitmq/index.js b/_examples/rabbitmq/index.js deleted file mode 100644 index ca44a28..0000000 --- a/_examples/rabbitmq/index.js +++ /dev/null @@ -1,15 +0,0 @@ -var express = require('express'); -var app = express(); -var amqp = require('amqplib'); - -app.get('/', function(req, res) { - amqp.connect('amqp://rabbitmq').then(function(conn) { - return conn.createChannel(); - }).then(function(ch) { - res.send('Connected to rabbitmq'); - }).catch(function() { - res.send('Could not connect to rabbitmq'); - }); -}); - -app.listen(8000); diff --git a/_examples/rabbitmq/package.json b/_examples/rabbitmq/package.json deleted file mode 100644 index 80f7682..0000000 --- a/_examples/rabbitmq/package.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "example-rabbitmq-node-docker", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "author": "", - "license": "MIT", - "dependencies": { - "amqplib": "^0.4.2", - "express": "^4.14.0" - } -} diff --git a/apache/Dockerfile b/apache/Dockerfile index 9e3c2aa..d1d1997 100644 --- a/apache/Dockerfile +++ b/apache/Dockerfile @@ -7,10 +7,11 @@ RUN mkdir /usr/local/apache2/templates \ && mkdir /usr/local/apache2/sites-available \ && rm /usr/local/apache2/conf/httpd.conf \ && rm /usr/local/apache2/conf/extra/*.conf -ADD httpd.conf /usr/local/apache2/conf + +COPY httpd.conf /usr/local/apache2/conf/httpd.conf COPY scripts /root/scripts/ -COPY certs/* /etc/ssl/ +COPY certs /etc/ssl/ COPY sites /usr/local/apache2/templates diff --git a/apache/certs/.gitkeep b/apache/certs/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/apache/httpd.conf b/apache/httpd.conf index 6f85a97..fe0f4b2 100644 --- a/apache/httpd.conf +++ b/apache/httpd.conf @@ -1,5 +1,6 @@ ServerRoot "/usr/local/apache2" +LoadModule mpm_event_module modules/mod_mpm_event.so LoadModule authn_file_module modules/mod_authn_file.so LoadModule authn_core_module modules/mod_authn_core.so LoadModule authz_host_module modules/mod_authz_host.so @@ -28,7 +29,6 @@ LoadModule alias_module modules/mod_alias.so User www-data Group www-data - ServerAdmin you@example.com diff --git a/docker-compose.yml b/docker-compose.yml index bc6c37a..4736940 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,4 @@ -version: '2' +version: '3.3' services: @@ -23,8 +23,8 @@ services: - MYSQL_USER=default_user - MYSQL_PASSWORD=secret - MYSQL_ROOT_PASSWORD=root - volumes_from: - - volumes + volumes: + - ./data/mysql/:/var/lib/mysql expose: - "3306" @@ -32,8 +32,8 @@ services: build: ./mongo expose: - "27017" - volumes_from: - - volumes + volumes: + - ./data/mongo/:/var/lib/mongodb nginx: build: @@ -43,8 +43,9 @@ services: - WEB_SSL=false - SELF_SIGNED=false - NO_DEFAULT=false - volumes_from: - - volumes + volumes: + - ./data/logs/nginx/:/var/log/nginx + - ./certbot/certs/:/var/certs ports: - "80:80" - "443:443" @@ -58,8 +59,9 @@ services: - WEB_SSL=false - SELF_SIGNED=false - NO_DEFAULT=false - volumes_from: - - volumes + volumes: + - ./data/logs/apache/:/usr/local/apache2/logs + - ./certbot/certs/:/var/certs ports: - "80:80" - "443:443" @@ -71,8 +73,9 @@ services: links: - apache - nginx - volumes_from: - - volumes + volumes: + - ./certbot/letsencrypt/:/var/www/letsencrypt + - ./certbot/certs/:/var/certs rabbitmq: build: @@ -95,14 +98,10 @@ services: - nginx volumes: - ../:/opt/app - volumes_from: - - volumes memcached: build: context: ./memcached - volumes_from: - - volumes expose: - "11211" @@ -116,13 +115,3 @@ services: - "29015" ports: - "28080:8080" - - volumes: - image: tianon/true - volumes: - - ./certbot/letsencrypt/:/var/www/letsencrypt - - ./certbot/certs/:/var/certs - - ./data/mysql:/var/lib/mysql - - ./data/mongo:/var/lib/mongodb - - ./data/logs/nginx/:/var/log/nginx - - ./data/logs/apache/:/usr/local/apache2/logs diff --git a/docs/index.html b/docs/index.html index 6135047..eba46df 100644 --- a/docs/index.html +++ b/docs/index.html @@ -31,7 +31,7 @@ ga('create', 'UA-87277646-1', 'auto'); ga('send', 'pageview'); - Fork me on GitHub + Fork me on GitHub
@@ -59,7 +59,7 @@

Framework Agnostic

Better, Faster & Stronger

- Docker + Docker Compose ensures your environment is fast and stable for development, testing and production. + Docker + Docker Compose v3 ensures your environment is fast and stable for development, testing and production.

@@ -110,4 +110,4 @@
... with more coming!
- \ No newline at end of file +