-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #316 from freezingsaddles/fix-docker-compose-setup
Fix freezing-web docker-compose setup
- Loading branch information
Showing
19 changed files
with
312 additions
and
258 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
*.pyc | ||
*.tmp | ||
.env* | ||
.gitkeep | ||
.venv* | ||
/*.iml | ||
/build | ||
|
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,18 @@ | ||
--- | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v5.0.0 | ||
hooks: | ||
- id: check-yaml | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
- repo: https://github.com/psf/black | ||
rev: 24.10.0 | ||
hooks: | ||
- id: black | ||
- repo: https://github.com/jackdewinter/pymarkdown | ||
rev: v0.9.26 | ||
hooks: | ||
- id: pymarkdown | ||
args: | ||
- "-d MD013 scan ." |
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 |
---|---|---|
|
@@ -6,4 +6,3 @@ echo "*** isort ***" | |
isort freezing | ||
echo "*** djlint ***" | ||
djlint --reformat freezing/web/templates | ||
|
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 |
---|---|---|
|
@@ -9,4 +9,3 @@ flake8 freezing | |
echo "*** mypy ***" | ||
echo "*** djlint ***" | ||
djlint --check freezing/web/templates | ||
|
File renamed without changes.
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,55 +1,58 @@ | ||
--- | ||
version: '3' | ||
|
||
volumes: | ||
freezing-data: | ||
external: true | ||
|
||
services: | ||
|
||
freezing-db: | ||
image: mysql:5.7 | ||
container_name: freezing-db | ||
image: mysql:8.0 | ||
container_name: freezing-db-dev | ||
ports: | ||
- "3306:3306" | ||
- "${MYSQL_PORT:-3306}:3306" | ||
volumes: | ||
- freezing-data:/var/lib/mysql | ||
- ./docker/db/sql-scripts:/sql | ||
- ./data/mysql/data:/var/lib/mysql | ||
- ./data/mysql/sql:/sql | ||
environment: | ||
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-fr33z3} | ||
MYSQL_DATABASE: ${MYSQL_DATABASE:-freezing} | ||
MYSQL_USER: ${MYSQL_USER:-freezing} | ||
MYSQL_PASSWORD: ${MYSQL_PASSWORD:-zeer0} | ||
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-fr33z3} | ||
MYSQL_ROOT_USER: ${MYSQL_ROOT_USER:-root} | ||
MYSQL_USER: ${MYSQL_USER:-freezing} | ||
|
||
freezing-web: | ||
build: . | ||
container_name: freezing-web | ||
command: bafs-server | ||
build: ./ | ||
container_name: freezing-web-dev | ||
depends_on: | ||
- freezing-db | ||
ports: | ||
- "5000:8000" | ||
- "${FREEZING_WEB_PORT:-8000}:8000" | ||
volumes: | ||
- ./data/cache:/data/cache | ||
- ./leaderboards:/data/leaderboards | ||
- ./data/sessions:/data/sessions | ||
- ./resources/docker/settings.cfg:/config/settings.cfg | ||
links: | ||
- freezing-db:freezing-db.container | ||
environment: | ||
BEANSTALKD_HOST: ${BEANSTALKD_HOST:-beanstalkd.invalid} | ||
BEANSTALKD_PORT: ${BEANSTALKD_PORT:-11300} | ||
BIND_INTERFACE: "0.0.0.0" | ||
VIRTUAL_HOST: ${FREEZING_WEB_FQDN} | ||
LETSENCRYPT_HOST: ${FREEZING_WEB_FQDN} | ||
LETSENCRYPT_EMAIL: ${LETSENCRYPT_EMAIL} | ||
SECRET_KEY: ${SECRET_KEY} | ||
DEBUG: ${DEBUG} | ||
SQLALCHEMY_URL: ${SQLALCHEMY_URL:-mysql+pymysql://freezing:[email protected]/freezing?charset=utf8mb4&binary_prefix=true} | ||
BEANSTALKD_HOST: beanstalkd.container | ||
BEANSTALKD_PORT: 11300 | ||
STRAVA_CLIENT_ID: ${STRAVA_CLIENT_ID} | ||
STRAVA_CLIENT_SECRET: ${STRAVA_CLIENT_SECRET} | ||
TEAMS: ${TEAMS} | ||
OBSERVER_TEAMS: ${OBSERVER_TEAMS} | ||
MAIN_TEAM: ${MAIN_TEAM} | ||
START_DATE: ${START_DATE} | ||
END_DATE: ${END_DATE} | ||
TIMEZONE: ${TIMEZONE:-America/New_York} | ||
COMPETITION_TITLE: ${COMPETITION_TITLE:-Freezing Saddles Local Dev} | ||
DEBUG: ${DEBUG:-True} | ||
END_DATE: ${END_DATE:-2118-03-20T00:01:00-04:00} | ||
ENVIRONMENT: ${ENVIRONMENT:-localdev} | ||
FAULTHANDLER: ${FAULT_HANDLER:-True} | ||
FORUM_SITE: https://www.bikearlingtonforum.com/forums/forum/freezing-saddles-winter-riding-competition/ # yamllint disable-line | ||
LETSENCRYPT_EMAIL: ${LETSENCRYPT_EMAIL:[email protected]} | ||
LETSENCRYPT_HOST: ${FREEZING_WEB_FQDN:-localhost.localdomain} | ||
LOG_LEVEL: ${LOG_LEVEL:-DEBUG} | ||
MAIN_TEAM: ${MAIN_TEAM:-324147} | ||
OBSERVER_TEAMS: ${OBSERVER_TEAMS:-5678,9013} | ||
REGISTRATION_SITE: ${REGISTRATION_SITE:-https://freezingsaddles.info/} | ||
SECRET_KEY: ${SECRET_KEY:-e6c07402-0307-11e8-b087-000000000000} # yamllint disable-line | ||
SQLALCHEMY_URL: "mysql+pymysql://${MYSQL_USER:-freezing}:${MYSQL_PASSWORD:-zeer0}@freezing-db-dev/${MYSQL_DATABASE:-freezing}?charset=utf8mb4&binary_prefix=true" # yamllint disable-line | ||
SQLALCHEMY_URL_ROOT: "mysql+pymysql://${MYSQL_ROOT_USER:-freezing}:${MYSQL_ROOT_PASSWORD:-zeer0}@freezing-db-dev/mysql?charset=utf8mb4&binary_prefix=true" # yamllint disable-line | ||
START_DATE: ${START_DATE:-2018-01-01T00:00:00-05:00} | ||
STRAVA_CLIENT_ID: ${STRAVA_CLIENT_ID:-?} | ||
STRAVA_CLIENT_SECRET: ${STRAVA_CLIENT_SECRET:-?} | ||
TEAMS: ${TEAMS:-1234,1235} | ||
TIMEZONE: ${TIMEZONE:-America/New_York} | ||
VIRTUAL_HOST: ${FREEZING_WEB_FQDN:-localhost.localdomain} |
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,44 +1,57 @@ | ||
# You can use a file containing environment vars like this: | ||
# APP_SETTINGS=/path/to/envfile.cfg freezing-server | ||
# | ||
# See freezing/webapp/config.py for more information on these settings. | ||
|
||
# Suitable same-machine testing. Set this to 0.0.0.0 to allow connections from other machines. | ||
BIND_INTERFACE=127.0.0.1 | ||
|
||
DEBUG=true | ||
|
||
# By default this uses the localdev environment for local development, which enables | ||
# several features useful for developers, such as user impersonation. | ||
# See | ||
#ENVIRONMENT=localdev | ||
|
||
# The SECRET_KEY is used by Flask to sign sessions. Set this to something else. | ||
SECRET_KEY=e6c07402-0307-11e8-b087-000000000000 | ||
|
||
# The URL to the database. Note that the pymysql driver must be explicitly specified. | ||
SQLALCHEMY_URL=mysql+pymysql://freezing:[email protected]/freezing?charset=utf8mb4&binary_prefix=true | ||
# | ||
# It is important to use the utf8mb4 charset to get full support for Unicode characters, | ||
# including emoji. | ||
# | ||
# This URL is suitable for use with the database running in the freezing-compose setup in this repository. | ||
SQLALCHEMY_URL="mysql+pymysql://freezing:zeer0mfreezing-db-dev/freezing?charset=utf8mb4&binary_prefix=true" | ||
# Use this one if you are running this on your host vs. the database in the | ||
# https://github.com/freezingsaddles/freezing-compose project. | ||
# NOTE: If you are using a MySQL docker via freezing-compose use 127.0.0.1 as the host, NOT localhost | ||
#SQLALCHEMY_URL="mysql+pymysql://freezing:[email protected]/freezing?charset=utf8mb4&binary_prefix=true" | ||
# If you keep your MySQL database somewhere else, fix this up to match. | ||
#SQLALCHEMY_URL="mysql+pymysql://freezing:[email protected]/freezing?charset=utf8mb4&binary_prefix=true"" | ||
|
||
# Configuration for the Strava client. These settings come from your App setup. | ||
# Setting this is only required if you are testing parts of this application that exercise the Strava API, | ||
# such as user registration. That is an advanced topic and not required to make most changes to | ||
# the web site. Most of the action with the Strava API happens in freezing-sync, not here. | ||
STRAVA_CLIENT_ID=? | ||
STRAVA_CLIENT_SECRET=? | ||
STRAVA_ACTIVITY_CACHE_DIR=/path/to/cache/activities | ||
|
||
WUNDERGROUND_API_KEY=? | ||
WUNDERGROUND_CACHE_DIR=/path/to/cache/wunderground | ||
|
||
# Main team ID that everyone should join | ||
MAIN_TEAM=324147 | ||
# Comma-separated list of Strava Clubs that are the participating teams. | ||
TEAMS=1234,1235 | ||
|
||
# Comma-separated list of teams that should be included for overall stats but are not "playing the game" | ||
OBSERVER_TEAMS=5678,9013 | ||
|
||
# Main team ID that everyone should join | ||
MAIN_TEAM=324147 | ||
|
||
# The competition title | ||
COMPETITION_TITLE='BikeArlington Freezing Saddles 2019' | ||
COMPETITION_TITLE='BikeArlington Freezing Saddles 2018 - localdev' | ||
|
||
# The start date of the competition -- WITH TIME ZONE | ||
START_DATE=2018-01-01T00:00:00-05:00 | ||
|
||
# The end date of the competition -- WITH TIME ZONE. The sync will stop fetching rides after this date (plus grace | ||
# period) | ||
# The end date of the competition -- WITH TIME ZONE. | ||
END_DATE=2018-03-20T00:01:00-04:00 | ||
|
||
# Related web sites | ||
REGISTRATION_SITE=https://freezingsaddles.info/ | ||
FORUM_SITE=https://www.bikearlingtonforum.com/forums/forum/freezing-saddles-winter-riding-competition/ | ||
REGISTRATION_SITE=https://freezingsaddles.info/ |
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import faulthandler | ||
import signal | ||
|
||
# Register this super early so we can get a stack trace if | ||
# there is a problem in initializing the config module | ||
faulthandler.register(signal.SIGUSR1) |
Oops, something went wrong.