Skip to content

Commit

Permalink
Updated Production config and deps install procedure
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperSuperDev committed Feb 11, 2022
1 parent edee6df commit d454689
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
1 change: 0 additions & 1 deletion compose/local/django/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
# OpenCV dependencies
libgtk2.0-dev \
pkg-config
# TODO Add ffmpeg, libgtk2.0-dev, pkg-config to production django Dockerfile

# Requirements are installed here to ensure they will be cached.
COPY ./requirements .
Expand Down
18 changes: 14 additions & 4 deletions compose/production/django/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ ARG APP_HOME=/app
WORKDIR ${APP_HOME}

COPY ./package.json ${APP_HOME}
RUN npm install && npm cache clean --force
COPY . ${APP_HOME}
RUN npm run build
# RUN npm install && npm cache clean --force
# COPY . ${APP_HOME}
# RUN npm run build

# define an alias for the specfic python version used in this file.
FROM python:${PYTHON_VERSION} as python
Expand All @@ -23,7 +23,12 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
# dependencies for building Python packages
build-essential \
# psycopg2 dependencies
libpq-dev
libpq-dev \
# ffmpeg dependencies
ffmpeg \
# OpenCV dependencies
libgtk2.0-dev \
pkg-config

# Requirements are installed here to ensure they will be cached.
COPY ./requirements .
Expand Down Expand Up @@ -55,6 +60,11 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
libpq-dev \
# Translations dependencies
gettext \
# ffmpeg dependencies
ffmpeg \
# OpenCV dependencies
libgtk2.0-dev \
pkg-config \
# cleaning up unused files
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
&& rm -rf /var/lib/apt/lists/*
Expand Down
4 changes: 4 additions & 0 deletions config/settings/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
)

# STORAGES
# TODO Add Infomaniak Objext storage
# ------------------------------------------------------------------------------
# https://django-storages.readthedocs.io/en/latest/#installation
INSTALLED_APPS += ["storages"] # noqa F405
Expand Down Expand Up @@ -94,6 +95,7 @@
]

# EMAIL
# TODO Create Nonovium Video Production email address
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#default-from-email
DEFAULT_FROM_EMAIL = env(
Expand All @@ -120,6 +122,7 @@
# https://docs.djangoproject.com/en/dev/ref/settings/#email-backend
# https://anymail.readthedocs.io/en/stable/installation/#anymail-settings-reference
# https://anymail.readthedocs.io/en/stable/esps/mailgun/
# TODO create mailgun account and update the email settings
EMAIL_BACKEND = "anymail.backends.mailgun.EmailBackend"
ANYMAIL = {
"MAILGUN_API_KEY": env("MAILGUN_API_KEY"),
Expand Down Expand Up @@ -184,6 +187,7 @@
}

# Sentry
# TODO Add/check Sentry
# ------------------------------------------------------------------------------
SENTRY_DSN = env("SENTRY_DSN")
SENTRY_LOG_LEVEL = env.int("DJANGO_SENTRY_LOG_LEVEL", logging.INFO)
Expand Down

0 comments on commit d454689

Please sign in to comment.