diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000..c837dec7af --- /dev/null +++ b/.dockerignore @@ -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/ diff --git a/.editorconfig b/.editorconfig index ae59e93541..26230e9483 100644 --- a/.editorconfig +++ b/.editorconfig @@ -5,6 +5,7 @@ indent_style = space indent_size = 2 insert_final_newline = true trim_trailing_whitespace = true +end_of_line = lf [*.{j,t}s] max_line_length = 100 diff --git a/Dockerfile b/Dockerfile index 105e997ea6..36e821bd7f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,24 @@ -FROM node:4-onbuild +FROM node:6.9 MAINTAINER Paris Kasidiaris -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 diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000000..9579dcf54d --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,9 @@ +version: '2' + +services: + web: + build: ./ + volumes: + - ./:/usr/src/app + ports: + - 3000:3000