-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
607d712
commit c7967e8
Showing
11 changed files
with
585 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
node_modules | ||
.dockerignore | ||
.env | ||
.gitignore | ||
database | ||
dist | ||
docker-compose.override.yml | ||
docker-compose.yml | ||
Dockerfile | ||
README.md | ||
.vscode | ||
*.log | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.env | ||
.env.production | ||
.env.staging | ||
dist | ||
node_modules | ||
.idea | ||
.vscode | ||
*.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
FROM node:8-alpine | ||
|
||
# Create app directory | ||
WORKDIR /usr/app | ||
|
||
# set app directoy ownership to user node of group node | ||
RUN chown -R node:node . | ||
|
||
# change user | ||
USER node | ||
|
||
# Install app dependencies | ||
# A wildcard is used to ensure both package.json AND package-lock.json are copied | ||
# where available (npm@5+) | ||
COPY package*.json ./ | ||
|
||
RUN npm install --only=production | ||
|
||
# build time argument to add tools for development | ||
ARG NODE_ENV=production | ||
|
||
# root level operations start here | ||
USER root | ||
|
||
# global install needs root privileges. Only installed during development | ||
RUN if [ "$NODE_ENV" = "development" ] ; then npm install -g nodemon ; fi | ||
|
||
# COPY always copies files as root. change owner after copy | ||
COPY ./src ./src | ||
RUN chown -R node:node ./src/* | ||
|
||
USER node | ||
|
||
EXPOSE 4000 | ||
CMD [ "node", "src/index.js" ] |
Oops, something went wrong.