Create docker files

This commit is contained in:
Pg
2021-02-24 12:09:50 +01:00
committed by Yann Armelin
parent 5302a2a20e
commit 081d7c1de5
4 changed files with 38 additions and 0 deletions

2
.dockerignore Normal file
View File

@@ -0,0 +1,2 @@
node_modules
npm-debug.log

14
Dockerfile Normal file
View File

@@ -0,0 +1,14 @@
FROM node:current
RUN mkdir -p /app
WORKDIR /app
COPY package.json .
RUN npm install -g npm@latest
RUN npm install
RUN npm install -g @angular/cli
COPY . .
EXPOSE 4200
CMD ["npx", "ng", "serve", "--host", "0.0.0.0", "--port", "4200"]

View File

@@ -40,6 +40,11 @@ Edit or create SVG paths in browser: https://yqnn.github.io/svg-path-editor/
## Running Locally
### Docker
Run `docker build -t svg-path-editor . && run -p 4200:4200 svg-path-editor` or `docker-compose up`.
### Manually
##### Requirements
- [Node.js](https://nodejs.org/) v12.0 or higher

17
docker-compose.yml Normal file
View File

@@ -0,0 +1,17 @@
version: "3"
services:
web-server:
build: .
ports:
- 4200:4200
volumes:
- .:/app
command:
- bash
- -c
- |
if [ ! -f './node_modules/docker_init' ]; then
npm install --no-bin-links
touch node_modules/docker_init
fi
npx ng serve --host 0.0.0.0 --port 4200