Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
libre
webschlocker3
Commits
6f94dfb7
Commit
6f94dfb7
authored
Apr 22, 2016
by
Michał 'rysiek' Woźniak
Browse files
bugfixes, moar bugfixes! also, now it seems to work
parent
4ac5f80b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
3 deletions
+19
-3
Dockerfile
Dockerfile
+1
-1
entrypoint.sh
entrypoint.sh
+18
-2
No files found.
Dockerfile
View file @
6f94dfb7
...
...
@@ -23,4 +23,4 @@ RUN chmod a+x /sbin/entrypoint.sh
WORKDIR
/opt/webschleuder3
EXPOSE
3000
ENTRYPOINT
["/sbin/entrypoint.sh"]
CMD
["bundle", "exec", "rails", "server", "-b", "$$WEBSCHLOCKER_BIND_ADDRESS", "-p", "$$WEBSCHLOCKER_BIND_PORT", "-e", "production"]
\ No newline at end of file
CMD
["bundle", "exec", "rails", "server", "-b", "$WEBSCHLOCKER_BIND_ADDRESS", "-p", "$WEBSCHLOCKER_BIND_PORT", "-e", "production"]
\ No newline at end of file
entrypoint.sh
View file @
6f94dfb7
...
...
@@ -46,6 +46,8 @@ function abort {
# only internal use for the time being
WEBSCHLOCKER_CONFIG_DIR
=
"/opt/webschleuder3/config"
WEBSCHLOCKER_LOG_DIR
=
"/opt/webschleuder3/log"
WEBSCHLOCKER_TMP_DIR
=
"/opt/webschleuder3/tmp"
#
# inform
echo
"+-- working with:"
...
...
@@ -145,7 +147,11 @@ if [ ! -e "$WEBSCHLOCKER_CONFIG_DIR/webschleuder.yml" ]; then
# hopefully the unneeded settings will be ignored ;)
# For delivery_method, sendmail_settings and smtp_settings see
# <http://guides.rubyonrails.org/action_mailer_basics.html#action-mailer-configuration>.
#
# yes, the "defaults:" section is required, even though we're not using it.
WEBSCHLOCKER_CONFIG
=
"
defaults: {}
production:
web_hostname:
$WEBSCHLOCKER_CONFIG_HOSTNAME
schleuderd_uri:
$WEBSCHLOCKER_CONFIG_SCHLEUDERD_URI
...
...
@@ -200,7 +206,7 @@ fi
# see: https://git.codecoop.org/schleuder/webschleuder3/blob/master/config/secrets.yml
if
[
!
-e
"
$WEBSCHLOCKER_CONFIG_DIR
/secrets.yml"
]
;
then
echo
"+-- no secrets file found in
$WEBSCHLOCKER_CONFIG_DIR
/secrets.yml, creating one..."
WESCHLOCKER_SECRETS
=
"
WE
B
SCHLOCKER_SECRETS
=
"
production:
secret_key_base:
$WEBSCHLOCKER_SECRET_KEY_BASE
"
...
...
@@ -210,15 +216,25 @@ else
fi
#
# log
file
# log
directory
echo
"+-- creating and setting permissions on the log directory '
$WEBSCHLOCKER_LOG_DIR
'"
mkdir
-p
"
$WEBSCHLOCKER_LOG_DIR
"
chown
-R
"
$WEBSCHLOCKER_USER
:
$WEBSCHLOCKER_GROUP
"
"
$WEBSCHLOCKER_LOG_DIR
"
#
# tmp directory
echo
"+-- creating and setting permissions on the tmp directory '
$WEBSCHLOCKER_TMP_DIR
'"
mkdir
-p
"
$WEBSCHLOCKER_TMP_DIR
"
chown
-R
"
$WEBSCHLOCKER_USER
:
$WEBSCHLOCKER_GROUP
"
"
$WEBSCHLOCKER_TMP_DIR
"
# prep the database (as the correct user)
echo
"+-- setting up the database"
su
-p
-c
"env PATH=
\"
$PATH
\"
bundle exec rake db:setup RAILS_ENV=production"
"
$WEBSCHLOCKER_USER
"
# make sure the envvars are available within su
export
WEBSCHLOCKER_BIND_ADDRESS WEBSCHLOCKER_BIND_PORT
# do the magic!
echo
"+-- executing:"
echo
"
$*
"
exec
su
-p
-c
"env PATH=
\"
$PATH
\"
$*
"
"
$WEBSCHLOCKER_USER
"
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment