Add some docker components

This commit is contained in:
Jake Howard 2018-01-26 19:56:43 +00:00
parent fb7764b3c7
commit 44c64d4f05
Signed by: jake
GPG key ID: 57AFB45680EDD477
2 changed files with 41 additions and 0 deletions

20
Dockerfile Normal file
View file

@ -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

View file

@ -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:<port>`.
### 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 --`