Add some docker components
This commit is contained in:
parent
fb7764b3c7
commit
44c64d4f05
2 changed files with 41 additions and 0 deletions
20
Dockerfile
Normal file
20
Dockerfile
Normal 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
|
21
README.md
21
README.md
|
@ -57,3 +57,24 @@ Enable opbeat error reporting. `--opbeat` only enables this, configuration is do
|
||||||
|
|
||||||
##### `open`
|
##### `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>`.
|
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 --`
|
Reference in a new issue