Merge pull request #403 from akalipetis/docker-enhancement
Improve the Docker image
This commit is contained in:
@@ -0,0 +1,16 @@
|
|||||||
|
node_modules/
|
||||||
|
*.swp
|
||||||
|
.lock-wscript
|
||||||
|
lib/
|
||||||
|
Makefile.gyp
|
||||||
|
*.Makefile
|
||||||
|
*.target.gyp.mk
|
||||||
|
*.node
|
||||||
|
example/*.log
|
||||||
|
docs/
|
||||||
|
npm-debug.log
|
||||||
|
/.idea/
|
||||||
|
.env
|
||||||
|
build/
|
||||||
|
.vscode/
|
||||||
|
.git/
|
||||||
@@ -5,6 +5,7 @@ indent_style = space
|
|||||||
indent_size = 2
|
indent_size = 2
|
||||||
insert_final_newline = true
|
insert_final_newline = true
|
||||||
trim_trailing_whitespace = true
|
trim_trailing_whitespace = true
|
||||||
|
end_of_line = lf
|
||||||
|
|
||||||
[*.{j,t}s]
|
[*.{j,t}s]
|
||||||
max_line_length = 100
|
max_line_length = 100
|
||||||
|
|||||||
+22
-2
@@ -1,4 +1,24 @@
|
|||||||
FROM node:4-onbuild
|
FROM node:6.9
|
||||||
MAINTAINER Paris Kasidiaris <paris@sourcelair.com>
|
MAINTAINER Paris Kasidiaris <paris@sourcelair.com>
|
||||||
|
|
||||||
EXPOSE 3000
|
# Install cpio, used for building
|
||||||
|
RUN apt-get update \
|
||||||
|
&& apt-get install -y --no-install-recommends cpio \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# Set the working directory
|
||||||
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
|
# Set an entrypoint, to automatically install node modules
|
||||||
|
ENTRYPOINT ["/bin/bash", "-c", "if [[ ! -d node_modules ]]; then npm install; fi; exec \"${@:0}\";"]
|
||||||
|
CMD ["npm", "run", "dev"]
|
||||||
|
|
||||||
|
# First, install dependencies to improve layer caching
|
||||||
|
COPY package.json /usr/src/app/
|
||||||
|
RUN npm install
|
||||||
|
|
||||||
|
# Add the code
|
||||||
|
COPY . /usr/src/app
|
||||||
|
|
||||||
|
# Run the tests and build, to make sure everything is working nicely
|
||||||
|
RUN npm run build && npm run test
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
version: '2'
|
||||||
|
|
||||||
|
services:
|
||||||
|
web:
|
||||||
|
build: ./
|
||||||
|
volumes:
|
||||||
|
- ./:/usr/src/app
|
||||||
|
ports:
|
||||||
|
- 3000:3000
|
||||||
Reference in New Issue
Block a user