Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
brainfood
/
astro-redux
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
2c7e9de3
authored
2024-05-02 13:39:39 -0500
by
Adam Heath
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
A helper script that runs node in a container.
1 parent
38e7b782
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
0 deletions
bin/run
container-entrypoint.sh
bin/run
0 → 100755
View file @
2c7e9de
#!/bin/sh
set
-e
TOP_DIR
=
"
$(
cd
"
$(
dirname
"
$0
"
)
/.."
;
pwd
-P
)
"
ti_arg
=
""
if
[
-t 0
]
;
then
ti_arg
=
"-ti"
fi
docker run --rm
$ti_arg
\
-e
UID_REMAP
=
$(
id -u
)
-e
GID_REMAP
=
$(
id -g
)
\
-v
"
$TOP_DIR
/container-entrypoint.sh:/container-entrypoint.sh"
--entrypoint /container-entrypoint.sh
\
-w /srv/app
\
-v
"
$TOP_DIR
:/srv/app"
\
$DOCKER_ARGS
\
node
"
$@
"
container-entrypoint.sh
0 → 100755
View file @
2c7e9de
#!/bin/bash
set
-e
if
[[
0 -eq
$(
id -u
)
]]
;
then
[[
$UID_REMAP
]]
&&
usermod -u
$UID_REMAP
node
[[
$GID_REMAP
]]
&&
groupmod -g
$GID_REMAP
node
fi
if
[[
$#
-eq 0
]]
;
then
set
-- bash
fi
cmd
=
"
$1
"
shift
start-stop-daemon -c node -d
$PWD
-u node --start --exec
"
$(
which
"
$cmd
"
)
"
--
"
$@
"
Please
register
or
sign in
to post a comment