-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
previously the dockerfile installed the dependencies and you then would mount the source folder into the container, shadowing the just created node_modules folder. So this setup only works if you had a node_modules folder on the host machine already which was kind of the reason to use docker in first place. To make this work, install the app into a subfolder and create the node_modules on folder up. Adopted some example files from here: - https://github.com/BretFisher/node-docker-good-defaults Also added a Makefile :-) So you can just do a 'make docker-server' or 'make docker-build'.
- Loading branch information
Showing
8 changed files
with
53 additions
and
45 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,6 @@ | ||
# add git-ignore syntax here of things you don't want copied into docker image | ||
|
||
.git | ||
*Dockerfile* | ||
*docker-compose* | ||
node_modules |
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
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
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,20 @@ | ||
#!/usr/bin/make -f | ||
|
||
DOCKERRUN=docker run \ | ||
--rm -it \ | ||
-p 5173:5173 \ | ||
--name=naemon-docs \ | ||
-v `pwd`:/opt/node_app/app \ | ||
-v /opt/node_app/node_modules/ \ | ||
-v /opt/node_app/app/.vitepress/cache \ | ||
-v /opt/node_app/app/.vitepress/dist \ | ||
-v `pwd`/package.json:/opt/node_app/package.json \ | ||
naemon/docs:latest | ||
|
||
docker-build: | ||
docker build -t naemon/docs . | ||
$(DOCKERRUN) npm run docs:build | ||
|
||
docker-server: | ||
docker build -t naemon/docs . | ||
$(DOCKERRUN) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
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,13 +1,17 @@ | ||
{ | ||
"name": "naemon-docs", | ||
"private": true, | ||
"version": "0.0.0", | ||
"devDependencies": { | ||
"vitepress": "^1.5.0" | ||
}, | ||
"scripts": { | ||
"docs:dev": "vitepress dev --host", | ||
"docs:build": "vitepress build", | ||
"docs:preview": "vitepress preview" | ||
"docs:dev": "npx vitepress dev --host", | ||
"docs:build": "npx vitepress build", | ||
"docs:preview": "npx vitepress preview" | ||
}, | ||
"dependencies": { | ||
"@fortawesome/fontawesome-free": "^6.7.0" | ||
} | ||
} | ||
} | ||
|