Compare commits
2 Commits
817b6bffd2
...
0816ceb40e
Author | SHA1 | Date |
---|---|---|
jason.zhu | 0816ceb40e | |
jason.zhu | 338c95a834 |
|
@ -0,0 +1,23 @@
|
||||||
|
**/.classpath
|
||||||
|
**/.dockerignore
|
||||||
|
**/.env
|
||||||
|
**/.git
|
||||||
|
**/.gitignore
|
||||||
|
**/.project
|
||||||
|
**/.settings
|
||||||
|
**/.toolstarget
|
||||||
|
**/.vs
|
||||||
|
**/.vscode
|
||||||
|
**/*.*proj.user
|
||||||
|
**/*.dbmdl
|
||||||
|
**/*.jfm
|
||||||
|
**/azds.yaml
|
||||||
|
**/charts
|
||||||
|
**/docker-compose*
|
||||||
|
**/Dockerfile*
|
||||||
|
**/node_modules
|
||||||
|
**/npm-debug.log
|
||||||
|
**/obj
|
||||||
|
**/secrets.dev.yaml
|
||||||
|
**/values.dev.yaml
|
||||||
|
README.md
|
|
@ -0,0 +1,49 @@
|
||||||
|
{
|
||||||
|
// Use IntelliSense to learn about possible attributes.
|
||||||
|
// Hover to view descriptions of existing attributes.
|
||||||
|
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"console": "integratedTerminal",
|
||||||
|
"internalConsoleOptions": "neverOpen",
|
||||||
|
"name": "nodemon",
|
||||||
|
"program": "${workspaceFolder}/app.js",
|
||||||
|
"request": "launch",
|
||||||
|
"restart": true,
|
||||||
|
"runtimeExecutable": "nodemon",
|
||||||
|
"skipFiles": [
|
||||||
|
"<node_internals>/**"
|
||||||
|
],
|
||||||
|
"type": "pwa-node"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address": "TCP/IP address of process to be debugged",
|
||||||
|
"localRoot": "${workspaceFolder}",
|
||||||
|
"name": "Attach to Remote",
|
||||||
|
"port": 9229,
|
||||||
|
"remoteRoot": "Absolute path to the remote directory containing the program",
|
||||||
|
"request": "attach",
|
||||||
|
"skipFiles": [
|
||||||
|
"<node_internals>/**"
|
||||||
|
],
|
||||||
|
"type": "pwa-node"
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"name": "Docker: Attach to Node.js",
|
||||||
|
"type": "node",
|
||||||
|
"request": "attach",
|
||||||
|
"remoteRoot": "/work/src/",
|
||||||
|
"port": 9229,
|
||||||
|
"address": "localhost",
|
||||||
|
"localRoot": "${workspaceFolder}/nodejs/src",
|
||||||
|
"protocol": "inspector",
|
||||||
|
"restart": true,
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,46 @@
|
||||||
|
{
|
||||||
|
"version": "2.0.0",
|
||||||
|
"tasks": [
|
||||||
|
{
|
||||||
|
"type": "docker-build",
|
||||||
|
"label": "docker-build",
|
||||||
|
"platform": "node",
|
||||||
|
"dockerBuild": {
|
||||||
|
"dockerfile": "${workspaceFolder}/nodejs/src/Dockerfile",
|
||||||
|
"context": "${workspaceFolder}/nodejs/src",
|
||||||
|
"pull": true
|
||||||
|
},
|
||||||
|
"node": {
|
||||||
|
"package": "${workspaceFolder}/nodejs/src/package.json"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "docker-run",
|
||||||
|
"label": "docker-run: release",
|
||||||
|
"dependsOn": [
|
||||||
|
"docker-build"
|
||||||
|
],
|
||||||
|
"platform": "node",
|
||||||
|
"node": {
|
||||||
|
"package": "${workspaceFolder}/nodejs/src/package.json"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "docker-run",
|
||||||
|
"label": "docker-run: debug",
|
||||||
|
"dependsOn": [
|
||||||
|
"docker-build"
|
||||||
|
],
|
||||||
|
"dockerRun": {
|
||||||
|
"env": {
|
||||||
|
"DEBUG": "*",
|
||||||
|
"NODE_ENV": "development"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node": {
|
||||||
|
"package": "${workspaceFolder}/nodejs/src/package.json",
|
||||||
|
"enableDebugging": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -39,9 +39,10 @@ services:
|
||||||
stdin_open: true
|
stdin_open: true
|
||||||
tty: true
|
tty: true
|
||||||
volumes:
|
volumes:
|
||||||
- ./nodejs/src/:/work
|
- ./nodejs/src/:/work/src/
|
||||||
ports:
|
ports:
|
||||||
- 5502:5000
|
- 5502:5000
|
||||||
|
- 9229:9229 # debug port
|
||||||
python: #docker run -it -v ${PWD}:/work -w /work -p 5003:5000 aimvector/python:1.0.0 /bin/sh
|
python: #docker run -it -v ${PWD}:/work -w /work -p 5003:5000 aimvector/python:1.0.0 /bin/sh
|
||||||
container_name: python
|
container_name: python
|
||||||
image: cruxlight/python_dev:1.0.0
|
image: cruxlight/python_dev:1.0.0
|
||||||
|
|
|
@ -27,7 +27,7 @@ services:
|
||||||
context: ./nodejs
|
context: ./nodejs
|
||||||
target: prod
|
target: prod
|
||||||
volumes:
|
volumes:
|
||||||
- ./nodejs/src/:/work
|
- ./nodejs/src/:/work/src
|
||||||
ports:
|
ports:
|
||||||
- 5502:5000
|
- 5502:5000
|
||||||
python: #docker run -it -v ${PWD}:/work -w /work -p 5003:5000 aimvector/python:1.0.0 /bin/sh
|
python: #docker run -it -v ${PWD}:/work -w /work -p 5003:5000 aimvector/python:1.0.0 /bin/sh
|
||||||
|
|
|
@ -0,0 +1,34 @@
|
||||||
|
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
|
||||||
|
// https://github.com/microsoft/vscode-dev-containers/tree/v0.158.0/containers/docker-existing-dockerfile
|
||||||
|
{
|
||||||
|
"name": "Existing Dockerfile",
|
||||||
|
|
||||||
|
// Sets the run context to one level up instead of the .devcontainer folder.
|
||||||
|
"context": "..",
|
||||||
|
|
||||||
|
// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
|
||||||
|
"dockerFile": "../Dockerfile",
|
||||||
|
|
||||||
|
// Set *default* container specific settings.json values on container create.
|
||||||
|
"settings": {
|
||||||
|
"terminal.integrated.shell.linux": null
|
||||||
|
},
|
||||||
|
|
||||||
|
// Add the IDs of extensions you want installed when the container is created.
|
||||||
|
"extensions": [],
|
||||||
|
|
||||||
|
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||||
|
"forwardPorts": [],
|
||||||
|
|
||||||
|
// Uncomment the next line to run commands after the container is created - for example installing curl.
|
||||||
|
// "postCreateCommand": "apt-get update && apt-get install -y curl",
|
||||||
|
|
||||||
|
// Uncomment when using a ptrace-based debugger like C++, Go, and Rust
|
||||||
|
// "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ],
|
||||||
|
|
||||||
|
// Uncomment to use the Docker CLI from inside the container. See https://aka.ms/vscode-remote/samples/docker-from-docker.
|
||||||
|
// "mounts": [ "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" ],
|
||||||
|
|
||||||
|
// Uncomment to connect as a non-root user if you've added one. See https://aka.ms/vscode-remote/containers/non-root.
|
||||||
|
// "remoteUser": "vscode"
|
||||||
|
}
|
|
@ -5,12 +5,21 @@ WORKDIR /work/
|
||||||
|
|
||||||
COPY ./src/package.json /work/package.json
|
COPY ./src/package.json /work/package.json
|
||||||
RUN npm install
|
RUN npm install
|
||||||
|
RUN npm install -g nodemon
|
||||||
|
|
||||||
COPY ./src/ /work/
|
COPY ./src/ /work/src/
|
||||||
|
|
||||||
|
# ENTRYPOINT [ "nodemon", "--inspect=0.0.0.0:9229", "./src/server.js" ]
|
||||||
|
# ENTRYPOINT [ "/usr/bin/top" ]
|
||||||
|
CMD top
|
||||||
|
|
||||||
###########START NEW IMAGE###################
|
###########START NEW IMAGE###################
|
||||||
|
|
||||||
FROM dev as prod
|
FROM node:12.4.0-alpine as prod
|
||||||
|
|
||||||
CMD node .
|
WORKDIR /work/
|
||||||
|
COPY ./src/package.json /work/package.json
|
||||||
|
RUN npm install
|
||||||
|
COPY ./src/ /work/
|
||||||
|
|
||||||
|
CMD node .
|
Loading…
Reference in New Issue