Create docker files
This commit is contained in:
2
.dockerignore
Normal file
2
.dockerignore
Normal file
@@ -0,0 +1,2 @@
|
||||
node_modules
|
||||
npm-debug.log
|
||||
14
Dockerfile
Normal file
14
Dockerfile
Normal 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"]
|
||||
@@ -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
17
docker-compose.yml
Normal 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
|
||||
Reference in New Issue
Block a user