Updated some comments.

master
Pacman Ghost 4 years ago
parent 21248450c3
commit a04fa82a14
  1. 5
      Dockerfile
  2. 4
      asl_articles/__init__.py
  3. 23
      run-containers.sh

@ -1,7 +1,8 @@
# NOTE: psycopg2-binary won't install into Alpine because pg_config is missing, and to install that,
# we need a full development environment :-/
# We do a multi-stage build (requires Docker >= 17.05) to install everything, then copy it all
# to the final target image.
# NOTE: psycopg2-binary won't install into Alpine because pg_config is missing, and to install that,
# we need a full development environment :-/
# https://github.com/psycopg/psycopg2/issues/684
FROM python:alpine3.7 AS base

@ -86,9 +86,7 @@ base_dir = os.path.join( BASE_DIR, ".." )
app = Flask( __name__ )
app.config.update( _cfg )
# connect to the database
# NOTE: We assume that this web server will only be handling a single user. If we ever have
# multiple concurrent users, we will need to change to per-session database connections.
# initialize the database connection
app.config[ "_IS_CONTAINER" ] = _cfg.get( "IS_CONTAINER" )
if _cfg.get( "IS_CONTAINER" ):
# if we are running in a container, the database must be specified in an env variable e.g.

@ -7,19 +7,18 @@ function print_help {
echo "`basename "$0"` {options}"
echo " Build and launch the \"asl-articles\" containers."
echo
echo " -t --tag Docker container tag e.g. \"testing\" or \"latest\"."
echo " -d --dbconn Database connection string e.g."
echo " ~/asl-articles.db (path to a SQLite database)"
echo " postgresql://USER:PASS@host/dbname (database connection string)"
echo " Note that the database server address is relative to the container i.e. NOT \"localhost\"."
echo " -e --extdocs Base directory for external documents (to allow articles to link to them)."
echo " -u --user-files Base directory for user files."
echo " -r --aslrb Base URL for an eASLRB."
echo " -t --tag Docker container tag e.g. \"testing\" or \"latest\"."
echo " -d --dbconn Database connection string e.g."
echo " ~/asl-articles.db (path to a SQLite database)"
echo " postgresql://USER:PASS@host/dbname (database connection string)"
echo " Note that the database server address is relative to the container i.e. NOT \"localhost\"."
echo " --web-portno Webapp port number."
echo " --flask-portno Flask backend server port number."
echo " -e --extdocs Base directory for external documents (to allow articles to link to them)."
echo " -u --user-files Base directory for user files."
echo " -r --aslrb Base URL for an eASLRB."
echo " -a --author-aliases Author aliases config file (see config/author-aliases.cfg.example)."
echo " --no-build Launch the containers as they are (i.e. without rebuilding them first)."
echo
echo " The TAG env variable can also be set to specify which containers to run e.g."
echo " TAG=testing `basename "$0"` /tmp/asl-articles.db"
echo " --no-build Launch the containers as they are (i.e. without rebuilding them first)."
}
# ---------------------------------------------------------------------

Loading…
Cancel
Save