Skip to content

Commit

Permalink
Changed lowercase build args to uppercase
Browse files Browse the repository at this point in the history
  • Loading branch information
philtrep committed Oct 12, 2016
1 parent cbb4a44 commit 2658756
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 52 deletions.
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,21 +78,21 @@ By default HTTPS is disabled. To enable it, you may use the following settings
nginx:
build:
args:
web_ssl: "true"
WEB_SSL: "true"
```
Add your certificate to `nginx/certs/cacert.pem` and the private key to `nginx/certs/privkey.pem`.
<a name="SelfSigned"></a>
#### Generate and use a self-signed cert
`self_signed: "true"` will generate the necessary files, do note that `self_signed: "true"` as no effect if `web_ssl: "false"`
`SELF_SIGNED: "true"` will generate the necessary files, do note that `SELF_SIGNED: "true"` as no effect if `WEB_SSL: "false"`

```
# docker-compose.override.yml
[...]
nginx:
build:
args:
web_ssl: "true"
self_signed: "true"
WEB_SSL: "true"
SELF_SIGNED: "true"
```
<a name="Certbot"></a>
#### Use Certbot (Let's Encrypt) to generate the cert
Expand All @@ -104,7 +104,7 @@ Add your certificate to `nginx/certs/cacert.pem` and the private key to `nginx/c
nginx:
build:
args:
web_ssl: "true"
WEB_SSL: "true"
certbot:
environment:
CN: "example.com"
Expand All @@ -121,12 +121,12 @@ The default NGINX server block configuration is aimed at web projects but if you
nginx:
build:
args:
no_default: "true"
NO_DEFAULT: "true"
ports:
- "10000:10000"
```

Do note that using `no_default` makes `web_reverse_proxy_port`, `web_ssl` and `self_signed` have no effect.
Do note that using `NO_DEFAULT` makes `WEB_REVERSE_PROXY_PORT`, `WEB_SSL` and `SELF_SIGNED` have no effect.

You will then have to provide your own NGINX server block like so

Expand Down Expand Up @@ -198,14 +198,14 @@ Use `main.js` instead of `index.js`
```
<a name="Node-Environment"></a>
#### Change the Node Environment
The default `node_env` value is `production`, you can change it to development by doing the following
The default `NODE_ENV` value is `production`, you can change it to development by doing the following
```
# docker-compose.override.yml
[...]
node:
build:
args:
node_env: development
NODE_ENV: development
```
<a name="Node-Version"></a>
#### Use a specific Node version
Expand All @@ -216,18 +216,18 @@ The default node version is `latest`, this is **NOT** advisable for production
node:
build:
args:
node_version: 4.6.0
NODE_VERSION: 4.6.0
```
<a name="Node-Project-Path"></a>
#### Change the Node project path
You can specify a `project_path` to change the directory in which `npm` will perform it's `install` command and the directory in which `run-nodock` will run the entrypoint script. This is most desirable when running more than one Node project at a time since they are bound to each have their own `package.json` file.
You can specify a `PROJECT_PATH` to change the directory in which `npm` will perform it's `install` command and the directory in which `run-nodock` will run the entrypoint script. This is most desirable when running more than one Node project at a time since they are bound to each have their own `package.json` file.
```
# docker-compose.override.yml
[...]
node:
build:
args:
project_path: somefolder # note that this is the same as "/opt/app/somefolder"
PROJECT_PATH: somefolder # note that this is the same as "/opt/app/somefolder"
```
<a name="MySQL-Database-User"></a>
Expand All @@ -238,8 +238,8 @@ You can specify a `project_path` to change the directory in which `npm` will per
mysql:
build:
args:
mysql_database: default_database
mysql_user: default_user
MYSQL_DATABASE: default_database
MYSQL_USER: default_user
mysql_password: secret
```
<a name="NGINX-Reverse-Proxy-Port"></a>
Expand All @@ -251,7 +251,7 @@ Use port `8080` instead of `8000` to bind your Node server
nginx:
build:
args:
web_reverse_proxy_port: "8080"
WEB_REVERSE_PROXY_PORT: "8080"
```
<a name="Change-the-timezone"></a>
#### Change the timezone
Expand All @@ -266,7 +266,7 @@ For example, if I want the timezone to be `New York`:
build:
context: ./workspace
args:
tz: "America/New_York"
TZ: "America/New_York"
```
<a name="Contributing"></a>
## Contributing
Expand Down
22 changes: 11 additions & 11 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ services:
build:
context: ./node
args:
node_version: latest
project_path: /opt/app/
node_env: production
NODE_VERSION: latest
PROJECT_PATH: /opt/app/
NODE_ENV: production
volumes:
- ../:/opt/app
extra_hosts:
Expand All @@ -20,8 +20,8 @@ services:
build:
context: ./mysql
args:
mysql_database: default_database
mysql_user: default_user
MYSQL_DATABASE: default_database
MYSQL_USER: default_user
mysql_password: secret
volumes_from:
- volumes
Expand All @@ -34,10 +34,10 @@ services:
build:
context: ./nginx
args:
web_reverse_proxy_port: "8000"
web_ssl: "false"
self_signed: "false"
no_default: "false"
WEB_REVERSE_PROXY_PORT: "8000"
WEB_SSL: "false"
SELF_SIGNED: "false"
NO_DEFAULT: "false"
volumes_from:
- volumes
ports:
Expand All @@ -59,8 +59,8 @@ services:
build:
context: ./workspace
args:
node_version: latest
tz: "UTC"
NODE_VERSION: latest
TZ: "UTC"
links:
- nginx
volumes:
Expand Down
8 changes: 4 additions & 4 deletions mysql/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ ADD startup /etc/mysql/startup

RUN chown -R mysql:root /var/lib/mysql/

ARG mysql_database
ARG mysql_user
ARG MYSQL_DATABASE
ARG MYSQL_USER
ARG mysql_password

ENV MYSQL_DATABASE=$mysql_database
ENV MYSQL_USER=$mysql_user
ENV MYSQL_DATABASE=$MYSQL_DATABASE
ENV MYSQL_USER=$MYSQL_USER
ENV MYSQL_PASSWORD=$mysql_password

RUN sed -i 's/MYSQL_DATABASE/'$MYSQL_DATABASE'/g' /etc/mysql/startup && \
Expand Down
16 changes: 8 additions & 8 deletions nginx/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ COPY certs/* /etc/ssl/

COPY sites /etc/nginx/templates

ARG web_reverse_proxy_port
ARG web_ssl
ARG self_signed
ARG no_default
ARG WEB_REVERSE_PROXY_PORT
ARG WEB_SSL
ARG SELF_SIGNED
ARG NO_DEFAULT

ENV WEB_REVERSE_PROXY_PORT=$web_reverse_proxy_port
ENV WEB_SSL=$web_ssl
ENV SELF_SIGNED=$self_signed
ENV NO_DEFAULT=$no_default
ENV WEB_REVERSE_PROXY_PORT=$WEB_REVERSE_PROXY_PORT
ENV WEB_SSL=$WEB_SSL
ENV SELF_SIGNED=$SELF_SIGNED
ENV NO_DEFAULT=$NO_DEFAULT

RUN /bin/bash /root/scripts/build-nginx.sh

Expand Down
14 changes: 7 additions & 7 deletions node/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ RUN apt-get update &&\
apt-get install -y npm &&\
npm install -g n

ARG node_env
ARG node_version
ARG project_path
ARG NODE_ENV
ARG NODE_VERSION
ARG PROJECT_PATH

ENV PROJECT_PATH=$project_path
ENV NODE_ENV=$node_env
ENV PROJECT_PATH=$PROJECT_PATH
ENV NODE_ENV=$NODE_ENV

# Add
RUN groupadd -r www-app &&\
useradd -r -g www-app www-app

# Install the specified node_version or grab latest
RUN n "$node_version"
# Install the specified NODE_VERSION or grab latest
RUN n "$NODE_VERSION"

COPY scripts/run-nodock.sh /usr/bin/run-nodock

Expand Down
12 changes: 6 additions & 6 deletions workspace/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ RUN apt-get update && \
## Timezone
##

ARG tz=UTC
ENV tz ${tz}
RUN ln -snf /usr/share/zoneinfo/$tz /etc/localtime && echo $tz > /etc/timezone
ARG TZ=UTC
ENV TZ ${TZ}
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

##
## Node
##

ARG node_version
ARG NODE_VERSION

# Install the specified node_version or grab latest
RUN n "$node_version"
# Install the specified NODE_VERSION or grab latest
RUN n "$NODE_VERSION"

##
## Cron
Expand Down

0 comments on commit 2658756

Please sign in to comment.