forked from gogs/gogs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Docker Container: Init 1 & Initialisation
- Now using a setup script before starting the app. The separation of the run script and the setup script will make service initialisation a little bit clearer - Now calling start.sh script as ENTRYPOINT and S6 as CMD. This way when running the container with just a shell script, the start.sh script will be launched before, making debugging easier - Added note about `.dockerignore` ignored during Docker Hub Automated Build
- Loading branch information
Showing
8 changed files
with
63 additions
and
37 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
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 |
---|---|---|
@@ -1,26 +1,8 @@ | ||
#!/bin/sh | ||
USER=git | ||
|
||
if ! test -d /data/gogs; then | ||
mkdir -p /data/gogs/data /data/gogs/conf /data/gogs/log /data/git | ||
if test -f ./setup; then | ||
source ./setup | ||
fi | ||
|
||
if ! test -d ~git/.ssh; then | ||
mkdir ~git/.ssh | ||
chmod 700 ~git/.ssh | ||
fi | ||
|
||
if ! test -f ~git/.ssh/environment; then | ||
echo "GOGS_CUSTOM=${GOGS_CUSTOM}" > ~git/.ssh/environment | ||
chmod 600 ~git/.ssh/environment | ||
fi | ||
|
||
cd /app/gogs | ||
|
||
ln -sf /data/gogs/log ./log | ||
ln -sf /data/gogs/data ./data | ||
|
||
chown -R git:git /data /app/gogs ~git/ | ||
|
||
export USER | ||
export USER=git | ||
exec gosu $USER /app/gogs/gogs web |
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,22 @@ | ||
#!/bin/sh | ||
|
||
if ! test -d /data/gogs; then | ||
mkdir -p /data/gogs/data /data/gogs/conf /data/gogs/log /data/git | ||
fi | ||
|
||
if ! test -d ~git/.ssh; then | ||
mkdir ~git/.ssh | ||
chmod 700 ~git/.ssh | ||
fi | ||
|
||
if ! test -f ~git/.ssh/environment; then | ||
echo "GOGS_CUSTOM=${GOGS_CUSTOM}" > ~git/.ssh/environment | ||
chmod 600 ~git/.ssh/environment | ||
fi | ||
|
||
cd /app/gogs | ||
|
||
ln -sf /data/gogs/log ./log | ||
ln -sf /data/gogs/data ./data | ||
|
||
chown -R git:git /data /app/gogs ~git/ |
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,15 +1,7 @@ | ||
#!/bin/sh | ||
|
||
if ! test -d /data/ssh | ||
then | ||
mkdir -p /data/ssh | ||
ssh-keygen -q -f /data/ssh/ssh_host_key -N '' -t rsa1 | ||
ssh-keygen -q -f /data/ssh/ssh_host_rsa_key -N '' -t rsa | ||
ssh-keygen -q -f /data/ssh/ssh_host_dsa_key -N '' -t dsa | ||
ssh-keygen -q -f /data/ssh/ssh_host_ecdsa_key -N '' -t ecdsa | ||
ssh-keygen -q -f /data/ssh/ssh_host_ed25519_key -N '' -t ed25519 | ||
chown -R root:root /data/ssh/* | ||
chmod 600 /data/ssh/* | ||
if test -f ./setup; then | ||
source ./setup | ||
fi | ||
|
||
exec gosu root /usr/sbin/sshd -D -f /app/gogs/docker/sshd_config |
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,12 @@ | ||
#!/bin/sh | ||
|
||
if ! test -d /data/ssh; then | ||
mkdir -p /data/ssh | ||
ssh-keygen -q -f /data/ssh/ssh_host_key -N '' -t rsa1 | ||
ssh-keygen -q -f /data/ssh/ssh_host_rsa_key -N '' -t rsa | ||
ssh-keygen -q -f /data/ssh/ssh_host_dsa_key -N '' -t dsa | ||
ssh-keygen -q -f /data/ssh/ssh_host_ecdsa_key -N '' -t ecdsa | ||
ssh-keygen -q -f /data/ssh/ssh_host_ed25519_key -N '' -t ed25519 | ||
chown -R root:root /data/ssh/* | ||
chmod 600 /data/ssh/* | ||
fi |
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