mirror of
https://github.com/Alexander-D-Karpov/akarpov
synced 2024-11-22 03:56:33 +03:00
fixed docker
This commit is contained in:
parent
c2aa3b76c7
commit
410a73a4ec
|
@ -1,5 +1,6 @@
|
||||||
DATABASE_URL=postgres://postgres:postgres@127.0.0.1:5432/akarpov
|
DATABASE_URL=postgres://postgres:postgres@127.0.0.1:5432/akarpov
|
||||||
CELERY_BROKER_URL=redis://localhost:6379/0
|
CELERY_BROKER_URL=redis://localhost:6379/0
|
||||||
REDIS_URL=redis://localhost:6379/1
|
REDIS_URL=redis://localhost:6379/1
|
||||||
|
REDIS_HOST=localhost
|
||||||
USE_DOCKER=no
|
USE_DOCKER=no
|
||||||
EMAIL_HOST=127.0.0.1:8025
|
EMAIL_HOST=127.0.0.1:8025
|
||||||
|
|
|
@ -5,8 +5,8 @@ IPYTHONDIR=/app/.ipython
|
||||||
DJANGO_READ_DOT_ENV_FILE=no
|
DJANGO_READ_DOT_ENV_FILE=no
|
||||||
# Redis
|
# Redis
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
REDIS_URL=redis://redis:6379/0
|
REDIS_URL=redis://redis:6379/1
|
||||||
CELERY_BROKER_URL=redis://localhost:6379/0
|
CELERY_BROKER_URL=redis://redis:6379/0
|
||||||
|
|
||||||
# Celery
|
# Celery
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
16
.envs/.production/.django
Normal file
16
.envs/.production/.django
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
# General
|
||||||
|
# CHANGE ON REAL SERVER
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
USE_DOCKER=yes
|
||||||
|
DJANGO_READ_DOT_ENV_FILE=no
|
||||||
|
# Redis
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
REDIS_URL=redis://redis:6379/0
|
||||||
|
CELERY_BROKER_URL=redis://localhost:6379/0
|
||||||
|
|
||||||
|
# Celery
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Flower
|
||||||
|
CELERY_FLOWER_USER=debug
|
||||||
|
CELERY_FLOWER_PASSWORD=debug
|
7
.envs/.production/.postgres
Normal file
7
.envs/.production/.postgres
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
# PostgreSQL
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
POSTGRES_HOST=postgres
|
||||||
|
POSTGRES_PORT=5432
|
||||||
|
POSTGRES_DB=akarpov
|
||||||
|
POSTGRES_USER=debug
|
||||||
|
POSTGRES_PASSWORD=debug
|
12
.github/workflows/ci.yml
vendored
12
.github/workflows/ci.yml
vendored
|
@ -59,15 +59,3 @@ jobs:
|
||||||
- name: Tear down the Stack
|
- name: Tear down the Stack
|
||||||
run: docker-compose -f local.yml down
|
run: docker-compose -f local.yml down
|
||||||
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout Code Repository
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Build the Stack
|
|
||||||
run: docker-compose -f production.yml build
|
|
||||||
|
|
||||||
- name: Tear down the Stack
|
|
||||||
run: docker-compose -f production.yml down
|
|
||||||
|
|
|
@ -0,0 +1,88 @@
|
||||||
|
# Generated by Django 4.1.4 on 2023-01-01 21:26
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
import django.db.models.deletion
|
||||||
|
import uuid
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
("contenttypes", "0002_remove_content_type_name"),
|
||||||
|
("pipeliner", "0004_multiplicationblock_storage_and_more"),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.CreateModel(
|
||||||
|
name="BaseStorage",
|
||||||
|
fields=[
|
||||||
|
(
|
||||||
|
"id",
|
||||||
|
models.UUIDField(
|
||||||
|
default=uuid.uuid4,
|
||||||
|
editable=False,
|
||||||
|
primary_key=True,
|
||||||
|
serialize=False,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"polymorphic_ctype",
|
||||||
|
models.ForeignKey(
|
||||||
|
editable=False,
|
||||||
|
null=True,
|
||||||
|
on_delete=django.db.models.deletion.CASCADE,
|
||||||
|
related_name="polymorphic_%(app_label)s.%(class)s_set+",
|
||||||
|
to="contenttypes.contenttype",
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
options={
|
||||||
|
"abstract": False,
|
||||||
|
"base_manager_name": "objects",
|
||||||
|
},
|
||||||
|
),
|
||||||
|
migrations.AlterModelOptions(
|
||||||
|
name="storage",
|
||||||
|
options={"base_manager_name": "objects"},
|
||||||
|
),
|
||||||
|
migrations.RemoveField(
|
||||||
|
model_name="storage",
|
||||||
|
name="id",
|
||||||
|
),
|
||||||
|
migrations.CreateModel(
|
||||||
|
name="RunnerStorage",
|
||||||
|
fields=[
|
||||||
|
(
|
||||||
|
"basestorage_ptr",
|
||||||
|
models.OneToOneField(
|
||||||
|
auto_created=True,
|
||||||
|
on_delete=django.db.models.deletion.CASCADE,
|
||||||
|
parent_link=True,
|
||||||
|
primary_key=True,
|
||||||
|
serialize=False,
|
||||||
|
to="pipeliner.basestorage",
|
||||||
|
),
|
||||||
|
),
|
||||||
|
("data", models.JSONField(default=dict)),
|
||||||
|
],
|
||||||
|
options={
|
||||||
|
"abstract": False,
|
||||||
|
"base_manager_name": "objects",
|
||||||
|
},
|
||||||
|
bases=("pipeliner.basestorage",),
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name="storage",
|
||||||
|
name="basestorage_ptr",
|
||||||
|
field=models.OneToOneField(
|
||||||
|
auto_created=True,
|
||||||
|
default=123,
|
||||||
|
on_delete=django.db.models.deletion.CASCADE,
|
||||||
|
parent_link=True,
|
||||||
|
primary_key=True,
|
||||||
|
serialize=False,
|
||||||
|
to="pipeliner.basestorage",
|
||||||
|
),
|
||||||
|
preserve_default=False,
|
||||||
|
),
|
||||||
|
]
|
|
@ -4,7 +4,6 @@ set -o errexit
|
||||||
set -o nounset
|
set -o nounset
|
||||||
|
|
||||||
python manage.py makemigrations
|
python manage.py makemigrations
|
||||||
python manage.py migrate auth
|
|
||||||
python manage.py migrate
|
python manage.py migrate
|
||||||
rm -f './celerybeat.pid'
|
rm -f './celerybeat.pid'
|
||||||
celery -A config.celery_app beat -l INFO
|
celery -A config.celery_app beat -l INFO
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
ARG PYTHON_VERSION=3.10-slim-bullseye
|
ARG PYTHON_VERSION=3.11-slim
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# define an alias for the specfic python version used in this file.
|
# define an alias for the specfic python version used in this file.
|
||||||
|
@ -17,13 +16,6 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
|
||||||
# psycopg2 dependencies
|
# psycopg2 dependencies
|
||||||
libpq-dev
|
libpq-dev
|
||||||
|
|
||||||
# Requirements are installed here to ensure they will be cached.
|
|
||||||
COPY ./requirements .
|
|
||||||
|
|
||||||
# Create Python Dependency and Sub-Dependency Wheels.
|
|
||||||
RUN pip wheel --wheel-dir /usr/src/app/wheels \
|
|
||||||
-r ${BUILD_ENVIRONMENT}.txt
|
|
||||||
|
|
||||||
|
|
||||||
# Python 'run' stage
|
# Python 'run' stage
|
||||||
FROM python as python-run-stage
|
FROM python as python-run-stage
|
||||||
|
@ -51,13 +43,15 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
|
||||||
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
|
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# All absolute dir copies ignore workdir instruction. All relative dir copies are wrt to the workdir instruction
|
|
||||||
# copy python dependency wheels from python-build-stage
|
|
||||||
COPY --from=python-build-stage /usr/src/app/wheels /wheels/
|
|
||||||
|
|
||||||
# use wheels to install python dependencies
|
RUN pip install poetry
|
||||||
RUN pip install --no-cache-dir --no-index --find-links=/wheels/ /wheels/* \
|
|
||||||
&& rm -rf /wheels/
|
# Configuring poetry
|
||||||
|
RUN poetry config virtualenvs.create false
|
||||||
|
COPY pyproject.toml poetry.lock /
|
||||||
|
|
||||||
|
# Installing requirements
|
||||||
|
RUN poetry install
|
||||||
|
|
||||||
COPY --chown=django:django ./compose/production/django/entrypoint /entrypoint
|
COPY --chown=django:django ./compose/production/django/entrypoint /entrypoint
|
||||||
RUN sed -i 's/\r$//g' /entrypoint
|
RUN sed -i 's/\r$//g' /entrypoint
|
||||||
|
|
|
@ -73,6 +73,11 @@
|
||||||
"auth.permission": {"ops": "all"},
|
"auth.permission": {"ops": "all"},
|
||||||
"*.*": {},
|
"*.*": {},
|
||||||
}
|
}
|
||||||
|
CACHEOPS_REDIS = {
|
||||||
|
'host': env.db("REDIS_HOST", default="redis"),
|
||||||
|
'port': 6379, # default redis port
|
||||||
|
'db': 1,
|
||||||
|
}
|
||||||
|
|
||||||
# URLS
|
# URLS
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in New Issue
Block a user