From 44c64d4f051ceeb24eb85f9466a81620ec1ae5b0 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Fri, 26 Jan 2018 19:56:43 +0000 Subject: [PATCH] Add some docker components --- Dockerfile | 20 ++++++++++++++++++++ README.md | 21 +++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..715db74 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +FROM node:6-alpine + +RUN mkdir -p /public + +COPY ./src /app/src +COPY ./package.json /app/package.json +COPY ./typings.json /app/typings.json +COPY ./tsconfig.json /app/tsconfig.json + +WORKDIR /app + +RUN npm install + +RUN node_modules/.bin/typings install + +RUN npm run build + +CMD npm start -- /public + +EXPOSE 5000 \ No newline at end of file diff --git a/README.md b/README.md index 084a479..5a58c5c 100644 --- a/README.md +++ b/README.md @@ -57,3 +57,24 @@ Enable opbeat error reporting. `--opbeat` only enables this, configuration is do ##### `open` Open the server in the browser one started. It will open in your default browser, and use url `http://0.0.0.0:`. + +### Docker +Included in this repo is a `Dockerfile` to use. The default setup requires being run from the project directory, and will serve `/public` in the container on port `5000`. By default, this directory is empty, however can be overriden. + +Below is an example `docker-compose.yml` file you can use with it: + +```yml +version: "2" +services: + tstatic: + image: "tstatic" + build: + context: . + dockerfile: Dockerfile + volumes: + - ./site/:/public + ports: + - "5000:5000" +``` + +__Note__: `tstatic` isn't installed into the path, so run it using `npm start --` \ No newline at end of file