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 --upgrade pip
|
||||||
RUN pip install flake8==3.9.2
|
RUN pip install flake8==3.9.2
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN flake8 --ignore=E501,F401 .
|
#RUN flake8 --ignore=E501,F401 .
|
||||||
|
|
||||||
# install dependencies
|
# install dependencies
|
||||||
COPY ./requirements.txt .
|
COPY ./requirements.txt .
|
||||||
|
|
|
@ -1,26 +1,22 @@
|
||||||
version: "3.9"
|
version: '3.8'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
db:
|
|
||||||
image: postgres
|
|
||||||
volumes:
|
|
||||||
- ./data/db:/var/lib/postgresql/data
|
|
||||||
environment:
|
|
||||||
- POSTGRES_DB=postgres
|
|
||||||
- POSTGRES_USER=postgres
|
|
||||||
- POSTGRES_PASSWORD=postgres
|
|
||||||
web:
|
web:
|
||||||
build: .
|
build: ./app
|
||||||
command: python manage.py runserver 0.0.0.0:8000
|
command: gunicorn gmba_django.wsgi:application --bind 0.0.0.0:8000
|
||||||
volumes:
|
|
||||||
- .:/code
|
|
||||||
ports:
|
ports:
|
||||||
- "8000:8000"
|
- 8000:8000
|
||||||
environment:
|
env_file:
|
||||||
- POSTGRES_NAME=app
|
- ./.env.prod
|
||||||
- POSTGRES_USER=app
|
|
||||||
- POSTGRES_PASSWORD=
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- db
|
- 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': {
|
'default': {
|
||||||
'ENGINE': os.environ.get('SQL_ENGINE', 'django.db.backends.sqlite3'),
|
'ENGINE': os.environ.get('SQL_ENGINE', 'django.db.backends.sqlite3'),
|
||||||
'NAME': os.environ.get('SQL_DATABASE', os.path.join(BASE_DIR, 'db.sqlite3')),
|
'NAME': os.environ.get('SQL_DATABASE', os.path.join(BASE_DIR, 'db.sqlite3')),
|
||||||
# 'USER': os.environ.get('SQL_USER', 'user'),
|
'USER': os.environ.get('SQL_USER', 'app'),
|
||||||
# 'PASSWORD': os.environ.get('SQL_PASSWORD', 'password'),
|
'PASSWORD': os.environ.get('SQL_PASSWORD', ''),
|
||||||
# 'HOST': os.environ.get('SQL_HOST', 'localhost'),
|
'HOST': os.environ.get('SQL_HOST', 'localhost'),
|
||||||
# 'PORT': os.environ.get('SQL_PORT', ''),
|
'PORT': os.environ.get('SQL_PORT', ''),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,3 +6,4 @@ sqlparse==0.4.1
|
||||||
typing-extensions==3.10.0.0
|
typing-extensions==3.10.0.0
|
||||||
psycopg2==2.9.1
|
psycopg2==2.9.1
|
||||||
Werkzeug==2.0.2
|
Werkzeug==2.0.2
|
||||||
|
gunicorn==20.1.0
|
||||||
|
|
Loading…
Reference in a new issue