diff --git a/Dockerfile b/Dockerfile index 0932570..d4c8617 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/README.md b/README.md index bd23628..dac8a7c 100644 --- a/README.md +++ b/README.md @@ -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| | -------- | ------ | @@ -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** | (default) | +| **PROMOTION_URL** | | | **ALLOW_ACCOUNTS_CREATION** | true , false | ## Tags @@ -33,10 +31,10 @@ Tags are written using the following pattern: `timeoff-management:. More info on docker hub: -### 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 diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 3b78e4d..cd9b048 100644 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -68,7 +68,7 @@ else { "production": { "dialect": "sqlite", - "storage": "./db.production.sqlite" + "storage": "./db.production.sqlite" } } EOF