WIP: fixing docker compose scritps
This commit is contained in:
parent
7fd30a5dcd
commit
3b9498d13d
4 changed files with 21 additions and 24 deletions
|
@ -20,7 +20,7 @@ RUN apk update \
|
|||
RUN pip install --upgrade pip
|
||||
RUN pip install flake8==3.9.2
|
||||
COPY . .
|
||||
RUN flake8 --ignore=E501,F401 .
|
||||
#RUN flake8 --ignore=E501,F401 .
|
||||
|
||||
# install dependencies
|
||||
COPY ./requirements.txt .
|
||||
|
|
|
@ -1,26 +1,22 @@
|
|||
version: "3.9"
|
||||
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
db:
|
||||
image: postgres
|
||||
volumes:
|
||||
- ./data/db:/var/lib/postgresql/data
|
||||
environment:
|
||||
- POSTGRES_DB=postgres
|
||||
- POSTGRES_USER=postgres
|
||||
- POSTGRES_PASSWORD=postgres
|
||||
web:
|
||||
build: .
|
||||
command: python manage.py runserver 0.0.0.0:8000
|
||||
volumes:
|
||||
- .:/code
|
||||
build: ./app
|
||||
command: gunicorn gmba_django.wsgi:application --bind 0.0.0.0:8000
|
||||
ports:
|
||||
- "8000:8000"
|
||||
environment:
|
||||
- POSTGRES_NAME=app
|
||||
- POSTGRES_USER=app
|
||||
- POSTGRES_PASSWORD=
|
||||
- 8000:8000
|
||||
env_file:
|
||||
- ./.env.prod
|
||||
depends_on:
|
||||
- db
|
||||
db:
|
||||
image: postgres:13.0-alpine
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data/
|
||||
env_file:
|
||||
- ./.env.prod
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
|
||||
|
|
|
@ -8,10 +8,10 @@ DATABASES = {
|
|||
'default': {
|
||||
'ENGINE': os.environ.get('SQL_ENGINE', 'django.db.backends.sqlite3'),
|
||||
'NAME': os.environ.get('SQL_DATABASE', os.path.join(BASE_DIR, 'db.sqlite3')),
|
||||
# 'USER': os.environ.get('SQL_USER', 'user'),
|
||||
# 'PASSWORD': os.environ.get('SQL_PASSWORD', 'password'),
|
||||
# 'HOST': os.environ.get('SQL_HOST', 'localhost'),
|
||||
# 'PORT': os.environ.get('SQL_PORT', ''),
|
||||
'USER': os.environ.get('SQL_USER', 'app'),
|
||||
'PASSWORD': os.environ.get('SQL_PASSWORD', ''),
|
||||
'HOST': os.environ.get('SQL_HOST', 'localhost'),
|
||||
'PORT': os.environ.get('SQL_PORT', ''),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -6,3 +6,4 @@ sqlparse==0.4.1
|
|||
typing-extensions==3.10.0.0
|
||||
psycopg2==2.9.1
|
||||
Werkzeug==2.0.2
|
||||
gunicorn==20.1.0
|
||||
|
|
Loading…
Reference in a new issue