Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Senzil #1

Merged
merged 2 commits into from
Aug 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 3 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
dev.db
venv/*
backups/*
static/
cabot/.collectstatic/
node_modules/*
.python-eggs/*
cabot.egg-info
cabot/static/
.env
.DS_Store
celerybeat-schedule
Expand All @@ -20,6 +18,7 @@ dist/
local_config.yml
build/
.dockerignore
docker.env
.idea
Pipfile.lock
.tox/
Expand Down Expand Up @@ -127,6 +126,7 @@ __pypackages__/
# Celery stuff
celerybeat-schedule
celerybeat.pid
.vscode

# SageMath parsed files
*.sage.py
Expand Down Expand Up @@ -166,8 +166,4 @@ cython_debug/

# End of https://www.toptal.com/developers/gitignore/api/python

Dockerfile
requirements-plugins.txt
requirements-dev.txt
setup.py
Dockerfile copy

13 changes: 10 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ RUN apk update && apk add --no-cache \
py-pip \
postgresql-dev \
mariadb-dev \
mysql-client \
gcc \
curl \
curl-dev \
Expand All @@ -19,7 +20,8 @@ RUN apk update && apk add --no-cache \
python3-dev \
musl-dev \
libevent-dev \
bash
bash \
git

# create and activate virtual environment
# using final folder name to avoid path issues with packages
Expand All @@ -38,10 +40,14 @@ WORKDIR /code
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt

COPY requirements-plugins.txt ./
RUN pip install --no-cache-dir -force-reinstall -r requirements-plugins.txt

########################################################
FROM python:3.6-alpine AS runner-image

RUN apk add --no-cache libpq
RUN apk add --no-cache libpq \
mariadb-connector-c-dev

RUN adduser -S cabot
COPY --from=builder-image /home/cabot/venv /home/cabot/venv
Expand All @@ -52,6 +58,7 @@ WORKDIR /home/cabot/code

COPY ./cabot ./cabot
COPY manage.py ./manage.py
COPY docker-entrypoint.sh ./docker-entrypoint.sh

EXPOSE 8000

Expand All @@ -68,4 +75,4 @@ ENV PATH="/home/cabot/venv/bin:$PATH"
#CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]


ENTRYPOINT ["docker-entrypoint.sh"]
ENTRYPOINT ["sh","docker-entrypoint.sh"]
71 changes: 0 additions & 71 deletions Dockerfile-j

This file was deleted.

66 changes: 66 additions & 0 deletions cabot/.env _example
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
DEBUG=True
PROD=False

#################### DATABASE CONFIG
#Check diferent options: https://github.com/kennethreitz/dj-database-url

DATABASE_NAME=cabot
DATABASE_USER=root
DATABASE_PASSWORD=root
DATABASE_HOST=db
DATABASE_PORT=3306

#################### PLUGINS - DON'T LEAVE SPACE BETWEEN THEM, ONLY COMMACABOT_PLUGINS=cabot_alert_slack,cabot_check_http,cabot_check_network,cabot_alert_email
CABOT_PLUGINS=cabot_alert_slack,cabot_check_http,cabot_check_network,cabot_alert_email

#################### GENERAL CONFIG
DJANGO_SETTINGS_MODULE=cabot.settings
LOG_FILE=/dev/null
PORT=8000
TIME_ZONE=America/Argentina/Buenos_Aires

#################### CELERY CONFIG
CELERY_BROKER_URL=redis://redis:6379/1
CELERY_RESULT_BACKEND=redis://redis:6379/1
CELERY_BEAT_SCHEDULER=django_celery_beat.schedulers:DatabaseScheduler

#################### DJANGO MAIL CONFIG
ADMIN_EMAIL=example@example.com
CABOT_FROM_EMAIL=example@example.com

#################### EMAIL ALERT CONFIG
EMAIL_HOST=in-v3.example.com
EMAIL_USER=example
EMAIL_PASSWORD=example

#################### SLACK CONFIG
SLACK_ALERT_CHANNEL=cabot
SLACK_WEBHOOK_URL=https://discord.com/api/webhooks
SLACK_ICON_URL=http://lorempixel.com/40/40/

# Typical SMTP port 587 or 25 configuration (with no SSL/TLS)
EMAIL_PORT=587
EMAIL_USE_TLS=0
EMAIL_USE_SSL=0

# URL of calendar to synchronise rota with
CALENDAR_ICAL_URL=http://www.google.com/calendar/ical/example.ics

# Django settings
DJANGO_SECRET_KEY=example

# User-Agent string used for HTTP checks
HTTP_USER_AGENT=Cabot

# Used for pointing links back in alerts etc.
WWW_HTTP_HOST=localhost
WWW_SCHEME=http

# Twilio integration for SMS and telephone alerts
#TWILIO_ACCOUNT_SID=your_account_sid
#TWILIO_AUTH_TOKEN=your_auth_token
#TWILIO_OUTGOING_NUMBER=+14155551234

# Hipchat integration
#HIPCHAT_ALERT_ROOM=room_name_or_id
#HIPCHAT_API_KEY=your_hipchat_api_key