Skip to content

Commit 31768cb

Browse files
committed
Adds guideslines for contrib and improves README of a few base-repos
1 parent 0075441 commit 31768cb

File tree

16 files changed

+41
-46
lines changed

16 files changed

+41
-46
lines changed

README.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,12 @@ issues where active help is required:
8686
Specifically,
8787

8888
1. Add support for more frameworks
89-
1. Optimise ``Dockerfile``s for faster builds, or for production (esp. for compiled languages)
89+
2. Optimise ``Dockerfile``s for faster builds, or for production (esp. for compiled languages)
90+
91+
Some important things to keep in mind when contributing:
92+
93+
1. Expose only one port, and one data volume to help keep things simple
94+
2. Annotate the ``Dockerfile`` with comments where you expect users to modify
95+
3. Try to document the following major use cases when writing your README: ``docker build``, ``git push`` based automated docker build, ``docker run``
96+
97+

elasticsearch/docker-config.yaml

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
image: "elasticsearch:latest"
22
port: 9200
3-
volume_mounts:
4-
- config: /usr/share/elasticsearch/config
5-
- data: /usr/share/elasticsearch/data
3+
volume_mounts: /usr/share/elasticsearch/data
64
env_variables: []

go-raw/docker-config.yaml

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
image: "go-server:<tag>"
2-
port: [8080]
3-
volume_mounts: []
2+
port: 8080
3+
volume_mounts: null
44
env_variables: []
5-
hasura_allowed_roles: ["admin","user","anonymous"]

joomla/docker-config.yaml

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
image: "joomla:latest"
2-
port: [80]
3-
volume_mounts:
4-
- config: "/var/www/html/installation/configuration.php-dist"
5-
- data: "/var/www/html"
2+
port: 80
3+
volume_mounts: "/var/www/html"
64
env_variables: ["JOOMLA_DB_HOST","JOOMLA_DB_USER","JOOMLA_DB_PASSWORD","JOOMLA_DB_NAME"]
7-
hasura_allowed_roles: ["admin","user","anonymous"]

mysql/docker-config.yaml

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
image: "hasura-mysql:<tag>"
2-
port: [3306]
3-
volume_mounts:
4-
- data: /var/lib/mysql
1+
image: "my-mysql:<tag>"
2+
port: 3306
3+
volume_mounts: /var/lib/mysql
54
env_variables: ["MYSQL_ROOT_PASSWORD","MYSQL_DATABASE","MYSQL_USER","MYSQL_PASSWORD"]
6-
hasura_allowed_roles: ["admin"]

nginx/Dockerfile

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
FROM nginx:latest
22

3-
COPY app/src/ /usr/share/nginx/html
3+
#Copy the configuration
44
COPY app/conf/nginx.conf /etc/nginx
5+
6+
#Copy the static files to be served
7+
COPY app/src/ /usr/share/nginx/html

nginx/docker-config.yaml

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
image: "nginx:latest"
2-
port: [80]
3-
volume_mounts:
4-
- config: "/etc/nginx/nginx.conf"
2+
port: 80
3+
volume_mounts: null
54
env_variables: ["NGINX_HOST", "NGINX_PORT"]
6-
hasura_allowed_roles: ["admin","user","anonymous"]

nodejs-express/app/src/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "hasura-express-example",
2+
"name": "quickstart-docker-express-example",
33
"version": "1.0.0",
44
"description": "Demo to show git push build and deploy",
55
"scripts": {

nodejs-express/docker-config.yaml

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
image: "nodejs-express:<tag>"
2-
port: [8080]
3-
volume_mounts: []
2+
port: 8080
3+
volume_mounts: null
44
env_variables: []
5-
hasura_allowed_roles: ["admin","user","anonymous"]

php-apache/docker-config.yaml

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
image: "php-apache:0.1"
2-
port: [8080]
3-
volume_mounts: []
2+
port: 8080
3+
volume_mounts: null
44
env_variables: []
5-
hasura_allowed_roles: ["admin","user","anonymous"]

python-django/docker-config.yaml

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
image: "python-djano:0.1"
2-
port: [8080]
3-
volume_mounts: []
2+
port: 8080
3+
volume_mounts: null
44
env_variables: []
5-
hasura_allowed_roles: ["admin","user","anonymous"]

python-flask/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Default Port for application is `8080` .
4040
Application port can be changed by modifying the variable `bind` in `app/conf/gunicorn_config.py` or setting Environment Variable
4141

4242
```python
43-
bind = "0.0.0.0:" + os.environ.get("APP_PORTS", "<NEW_PORT>")
43+
bind = "0.0.0.0:" + os.environ.get("APP_PORT", "<NEW_PORT>")
4444
```
4545

4646
```bash
@@ -49,8 +49,8 @@ $ docker run -d -p 8080:<NEW_PORT> python-flask:<tag>
4949

5050
### **Environment Variables**
5151

52-
* `APP_PORTS` - Application port can also be specified by setting APP_PORTS ENV
52+
* `APP_PORT` - Application port can also be specified by setting APP_PORT ENV
5353

5454
```bash
55-
$ docker run -d -p 8080:<NEW_PORT> -e APP_PORTS='<NEW_PORT>' python-flask:<tag>
55+
$ docker run -d -p 8080:<NEW_PORT> -e APP_PORT='<NEW_PORT>' python-flask:<tag>
5656
```

python-flask/app/conf/gunicorn_config.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import os
22
import multiprocessing
33

4-
bind = "0.0.0.0:" + os.environ.get("APP_PORTS", "8080")
4+
bind = "0.0.0.0:" + os.environ.get("APP_PORT", "8080")
55
workers = (multiprocessing.cpu_count() * 2) + 1
66
accesslog = "-"
77
access_log_format = '%(h)s %(l)s %(u)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s"'

python-flask/docker-config.yaml

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
image: "python-flask:<tag>"
2-
port: [8080]
3-
volume_mounts: []
4-
env_variables: ["APP_PORTS"]
5-
hasura_allowed_roles: ["admin","user","anonymous"]
2+
port: 8080
3+
volume_mounts: null
4+
env_variables: ["APP_PORT"]

ruby-rails/docker-config.yaml

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
image: "ruby-rails:0.1"
2-
port: [8080]
3-
volume_mounts: []
2+
port: 8080
3+
volume_mounts: null
44
env_variables: ["SECRET_KEY_BASE"]
5-
hasura_allowed_roles: ["admin","user","anonymous"]

wordpress/docker-config.yaml

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
image: "php-wordpress:<tag>"
2-
port: [80]
3-
volume_mounts:
4-
- data: /var/www/html
2+
port: 80
3+
volume_mounts: /var/www/html
54
env_variables: ["WORDPRESS_DB_HOST","WORDPRESS_DB_USER", "WORDPRESS_DB_PASSWORD"]

0 commit comments

Comments
 (0)