-
-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added node server and docker files and express * fixed env * vie is 8626 * fixing the folder to serve for Vue * now using port 9626
- Loading branch information
Showing
9 changed files
with
124 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
node_modules | ||
npm-debug.log | ||
Dockerfile* | ||
docker-compose* | ||
.dockerignore | ||
.git | ||
.gitignore | ||
.env | ||
*/bin | ||
*/obj | ||
README.md | ||
LICENSE | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
NODE_ENV=production | ||
PUBLIC_WEB=./public | ||
PORT=9626 | ||
VUE_APP_API=https://papa-heroes-node-api.azurewebsites.net/api |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
NODE_ENV=development | ||
PUBLIC_WEB=./public | ||
PORT=9626 | ||
VUE_APP_API=api |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Client App | ||
FROM node:10.13-alpine as client-app | ||
LABEL authors="John Papa" | ||
WORKDIR /usr/src/app | ||
COPY ["package.json", "npm-shrinkwrap.json*", "./"] | ||
RUN npm install --silent | ||
COPY . . | ||
ARG VUE_APP_API | ||
ENV VUE_APP_API $VUE_APP_API | ||
RUN npm run build | ||
|
||
# Node server | ||
FROM node:10.13-alpine as node-server | ||
WORKDIR /usr/src/app | ||
COPY ["package.json", "npm-shrinkwrap.json*", "./"] | ||
RUN npm install --production --silent && mv node_modules ../ | ||
COPY server.js . | ||
|
||
# Final image | ||
FROM node:10.13-alpine | ||
WORKDIR /usr/src/app | ||
# get the node_modules | ||
COPY --from=node-server /usr/src /usr/src | ||
# get the client app | ||
COPY --from=client-app /usr/src/app/dist ./public | ||
EXPOSE 9626 | ||
CMD ["node", "server.js"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
version: '2.1' | ||
|
||
services: | ||
heroes-vue: | ||
image: heroes-vue | ||
build: . | ||
context: . | ||
args: | ||
VUE_APP_API: ${VUE_APP_API} | ||
env_file: | ||
- .env.development | ||
ports: | ||
- 9626:9626 | ||
- 9229:9229 | ||
command: node --inspect=0.0.0.0:9229 server.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
version: '2.1' | ||
|
||
services: | ||
heroes-vue: | ||
image: heroes-vue | ||
build: | ||
context: . | ||
args: | ||
VUE_APP_API: ${VUE_APP_API} | ||
env_file: | ||
- .env | ||
ports: | ||
- 9626:9626 |
Oops, something went wrong.