Squashed commit of the following:
commit 99fd94580f95dcbfb77b73e2de846f76a5709ef9
Author: Sonny <sonnyba871@gmail.com>
Date: Sat Feb 15 21:45:16 2020 +0100
Use postgres password
As of https://gitlab.com/gitlab-com/support-forum/issues/5199
This commit is contained in:
parent
ee22e0a0ae
commit
5976870d38
5 changed files with 20 additions and 26 deletions
|
|
@ -23,8 +23,11 @@ python tests:
|
|||
variables:
|
||||
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
|
||||
DJANGO_SETTINGS_MODULE: "newsreader.conf.gitlab"
|
||||
POSTGRES_DB: newsreader
|
||||
POSTGRES_USER: newsreader
|
||||
POSTGRES_HOST: "$POSTGRES_HOST"
|
||||
POSTGRES_DB: "$POSTGRES_NAME"
|
||||
POSTGRES_NAME: "$POSTGRES_NAME"
|
||||
POSTGRES_USER: "$POSTGRES_USER"
|
||||
POSTGRES_PASSWORD: "$POSTGRES_PASSWORD"
|
||||
cache:
|
||||
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
|
||||
paths:
|
||||
|
|
|
|||
|
|
@ -6,8 +6,9 @@ services:
|
|||
image: postgres
|
||||
container_name: postgres
|
||||
environment:
|
||||
- POSTGRES_USER=newsreader
|
||||
- POSTGRES_DB=newsreader
|
||||
- POSTGRES_DB=$POSTGRES_NAME
|
||||
- POSTGRES_USER=$POSTGRES_USER
|
||||
- POSTGRES_PASSWORD=$POSTGRES_PASSWORD
|
||||
rabbitmq:
|
||||
image: rabbitmq:3.7
|
||||
container_name: rabbitmq
|
||||
|
|
@ -16,6 +17,10 @@ services:
|
|||
container_name: celery
|
||||
command: celery -A newsreader worker --beat --scheduler django --workdir=/app/src/
|
||||
environment:
|
||||
- POSTGRES_HOST=$POSTGRES_HOST
|
||||
- POSTGRES_NAME=$POSTGRES_NAME
|
||||
- POSTGRES_USER=$POSTGRES_USER
|
||||
- POSTGRES_PASSWORD=$POSTGRES_PASSWORD
|
||||
- DJANGO_SETTINGS_MODULE=newsreader.conf.docker
|
||||
volumes:
|
||||
- .:/app
|
||||
|
|
@ -26,6 +31,10 @@ services:
|
|||
container_name: web
|
||||
command: src/entrypoint.sh
|
||||
environment:
|
||||
- POSTGRES_HOST=$POSTGRES_HOST
|
||||
- POSTGRES_NAME=$POSTGRES_NAME
|
||||
- POSTGRES_USER=$POSTGRES_USER
|
||||
- POSTGRES_PASSWORD=$POSTGRES_PASSWORD
|
||||
- DJANGO_SETTINGS_MODULE=newsreader.conf.docker
|
||||
volumes:
|
||||
- .:/app
|
||||
|
|
|
|||
|
|
@ -84,8 +84,10 @@ WSGI_APPLICATION = "newsreader.wsgi.application"
|
|||
DATABASES = {
|
||||
"default": {
|
||||
"ENGINE": "django.db.backends.postgresql_psycopg2",
|
||||
"NAME": "newsreader",
|
||||
"USER": "newsreader",
|
||||
"HOST": os.environ.get("POSTGRES_HOST"),
|
||||
"NAME": os.environ.get("POSTGRES_NAME"),
|
||||
"USER": os.environ.get("POSTGRES_USER"),
|
||||
"PASSWORD": os.environ.get("POSTGRES_PASSWORD"),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,17 +1,6 @@
|
|||
from .dev import *
|
||||
|
||||
|
||||
# Database
|
||||
# https://docs.djangoproject.com/en/2.2/ref/settings/#databases
|
||||
DATABASES = {
|
||||
"default": {
|
||||
"ENGINE": "django.db.backends.postgresql_psycopg2",
|
||||
"NAME": "newsreader",
|
||||
"USER": "newsreader",
|
||||
"HOST": "db",
|
||||
}
|
||||
}
|
||||
|
||||
# Celery
|
||||
# https://docs.celeryproject.org/en/latest/userguide/configuration.html
|
||||
BROKER_URL = "amqp://guest:guest@rabbitmq:5672//"
|
||||
|
|
|
|||
|
|
@ -4,12 +4,3 @@ from .base import * # noqa
|
|||
DEBUG = True
|
||||
|
||||
EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"
|
||||
|
||||
DATABASES = {
|
||||
"default": {
|
||||
"ENGINE": "django.db.backends.postgresql_psycopg2",
|
||||
"NAME": "newsreader",
|
||||
"USER": "newsreader",
|
||||
"HOST": "postgres",
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue