Skip to content

Commit

Permalink
Dockerfile updated to support timeoff-management v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
João Pires committed Mar 12, 2020
1 parent 24fbcb7 commit 794a1a6
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 23 deletions.
24 changes: 11 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,30 +1,28 @@
# This is the base for our build step container
FROM node:9-alpine AS base

#Environment var to set pull request version
ENV PR_NUMBER 285
# Install dependencies
RUN apk add --no-cache git make python

#Install dependencies
RUN apk add --update --no-cache git

#Create and change to workdir
# Create and change to workdir
WORKDIR /app
RUN git clone https://github.com/timeoff-management/application.git timeoff-management

WORKDIR /app/timeoff-management

#Install dependencies
RUN npm install mysql && npm install --production
# Install dependencies
RUN npm install mysql && npm install --production

# This is our runtime container
FROM alpine:3.6
FROM alpine:3.8

#Install npm
RUN apk add --update nodejs-npm
# Install npm
RUN apk add --update nodejs npm

WORKDIR /app/timeoff-management
#Copy files from first stage
COPY --from=base /app/timeoff-management/ /app/timeoff-management

# Copy files from first stage
COPY --from=base /app/timeoff-management/ /app/timeoff-management

ADD docker-entrypoint.sh /docker-entrypoint.sh

Expand Down
16 changes: 7 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@

Docker implementation of the timeoff-management project

# Using Dockerfile
## Using Dockerfile

By default timeoff-management use sqlite and no smtp server configured.
By default timeoff-management use sqlite and no smtp server configured.



To change default configurations use **environment variables**.
To change default configurations use **environment variables**.

| Var Name | Possible values|
| -------- | ------ |
Expand All @@ -18,8 +16,8 @@ To change default configurations use **environment variables**.
| **SMTP_PORT** | port |
| **SMTP_USER** | username/address |
| **SMTP_PASSWORD** | password |
| **APP_URL** | http://app.timeoff.management (default) |
| **PROMOTION_URL** | http://timeoff.management |
| **APP_URL** | <http://app.timeoff.management> (default) |
| **PROMOTION_URL** | <http://timeoff.management> |
| **ALLOW_ACCOUNTS_CREATION** | true , false |

## Tags
Expand All @@ -33,10 +31,10 @@ Tags are written using the following pattern: `timeoff-management:<year>.<month>

More info on docker hub: <https://hub.docker.com/r/nosinovacao/timeoff-management/>

### Build and run docker image
### Build and run docker image

_Build_:
> $ docker build -t timeoff .
> $ docker build -t timeoff .
_Run_:
> $ docker run -e NODE_ENV=production -e MYSQL_USER=timeoff timeoff
2 changes: 1 addition & 1 deletion docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ else
{
"production": {
"dialect": "sqlite",
"storage": "./db.production.sqlite"
"storage": "./db.production.sqlite"
}
}
EOF
Expand Down

0 comments on commit 794a1a6

Please sign in to comment.