Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run apps inside Docker containers #379

Merged
merged 22 commits into from
Sep 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
c7a506e
client: docker changes, add start and stop buttons
ggwadera Sep 3, 2020
524ee2a
client: update logs links
ggwadera Sep 3, 2020
f5d5ba7
client: remove clear logs buttonDocker doesn't have an easy way to cl…
ggwadera Sep 3, 2020
76dce9e
npm: include 'dockerode' dependency
ggwadera Sep 3, 2020
a71d38a
helpers: docker helper functions
ggwadera Sep 3, 2020
38d8f8d
api/mappings: use docker
ggwadera Sep 3, 2020
7fc7eeb
api/logs: use single path with stream param
ggwadera Sep 3, 2020
aec3a23
post-receive: changed to start the container with docker
ggwadera Sep 3, 2020
2c853ae
setup: add users to the docker group
ggwadera Sep 3, 2020
de1d77d
api/mappings: remove unnecessary line from exec
ggwadera Sep 4, 2020
82efff1
docker: add force options to containerRemove
ggwadera Sep 4, 2020
a8f8507
misc fixes
ggwadera Sep 4, 2020
5fac5b0
mappings: fix isProduction() call
ggwadera Sep 4, 2020
e437c70
mappings: delete -> fix fs.unlink to fs.rmdir
ggwadera Sep 4, 2020
a3acc9f
mappings: revert delete back to exec
ggwadera Sep 4, 2020
de7ffa5
setup: check if docker is installed on the system
ggwadera Sep 4, 2020
2483cb8
setup: refactor and add more checks
ggwadera Sep 4, 2020
823727b
setup: create authorized_keys if not existent
ggwadera Sep 4, 2020
4580c81
setup: pull node docker image
ggwadera Sep 4, 2020
0ac964b
setup: check if user can run docker commands
ggwadera Sep 4, 2020
e00670b
setup: changed mkdir to use -p flag
ggwadera Sep 4, 2020
6ee578f
setup: add permissions comment
ggwadera Sep 4, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
182 changes: 179 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"@types/node-fetch": "^2.5.0",
"@types/uuid": "^3.4.5",
"cookie-parser": "^1.4.4",
"dockerode": "^3.2.1",
"dotenv": "^8.1.0",
"ejs": "^2.6.2",
"express": "^4.17.1",
Expand All @@ -48,6 +49,7 @@
"uuid": "^3.3.3"
},
"devDependencies": {
"@types/dockerode": "^2.5.34",
"@types/jest": "^24.0.17",
"@types/node": "^12.7.1",
"@typescript-eslint/eslint-plugin": "^2.0.0",
Expand Down
5 changes: 4 additions & 1 deletion scripts/post-receive
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
#!/bin/sh
cd ..
GIT_DIR='.git'
DOMAIN=$(basename $(pwd))
umask 002 && git reset --hard
git clean -f
git checkout master
git branch -D prod
npm install
sudo -u myproxy pm2 startOrRestart deploy.config.js --env production --update-env
echo "Starting the container..."
curl --silent --unix-socket /var/run/docker.sock -X POST "http:/localhost/containers/${DOMAIN}/restart"
echo "Your app is running at https://${DOMAIN}"
Loading