Undo Podman changes
This commit is contained in:
parent
8ef39ffe48
commit
9474a516ac
|
@ -2,8 +2,8 @@
|
||||||
FROM python:3
|
FROM python:3
|
||||||
ARG OPERATION
|
ARG OPERATION
|
||||||
|
|
||||||
RUN mkdir -p /code
|
|
||||||
RUN useradd -d /code xf
|
RUN useradd -d /code xf
|
||||||
|
RUN mkdir -p /code
|
||||||
RUN chown -R xf:xf /code
|
RUN chown -R xf:xf /code
|
||||||
|
|
||||||
RUN mkdir -p /conf/static
|
RUN mkdir -p /conf/static
|
||||||
|
@ -16,7 +16,7 @@ USER xf
|
||||||
ENV PYTHONDONTWRITEBYTECODE=1
|
ENV PYTHONDONTWRITEBYTECODE=1
|
||||||
ENV PYTHONUNBUFFERED=1
|
ENV PYTHONUNBUFFERED=1
|
||||||
WORKDIR /code
|
WORKDIR /code
|
||||||
COPY --chown=xf:xf requirements.txt /code/
|
COPY requirements.txt /code/
|
||||||
RUN python -m venv /venv
|
RUN python -m venv /venv
|
||||||
RUN . /venv/bin/activate && pip install -r requirements.txt
|
RUN . /venv/bin/activate && pip install -r requirements.txt
|
||||||
|
|
||||||
|
@ -25,4 +25,4 @@ RUN . /venv/bin/activate && pip install -r requirements.txt
|
||||||
CMD if [ "$OPERATION" = "uwsgi" ] ; then . /venv/bin/activate && uwsgi --ini /conf/uwsgi.ini ; else . /venv/bin/activate && exec python manage.py runserver 0.0.0.0:8000; fi
|
CMD if [ "$OPERATION" = "uwsgi" ] ; then . /venv/bin/activate && uwsgi --ini /conf/uwsgi.ini ; else . /venv/bin/activate && exec python manage.py runserver 0.0.0.0:8000; fi
|
||||||
|
|
||||||
# CMD . /venv/bin/activate && uvicorn --reload --reload-include *.html --workers 2 --uds /var/run/socks/app.sock app.asgi:application
|
# CMD . /venv/bin/activate && uvicorn --reload --reload-include *.html --workers 2 --uds /var/run/socks/app.sock app.asgi:application
|
||||||
# CMD . /venv/bin/activate && gunicorn -b 0.0.0.0:8000 --reload app.asgi:application -k uvicorn.workers.UvicornWorker
|
# CMD . /venv/bin/activate && gunicorn -b 0.0.0.0:8000 --reload app.asgi:application -k uvicorn.workers.UvicornWorker
|
18
Makefile
18
Makefile
|
@ -1,26 +1,26 @@
|
||||||
run:
|
run:
|
||||||
podman-compose --env-file=stack.env up -d
|
docker-compose --env-file=stack.env up -d
|
||||||
|
|
||||||
build:
|
build:
|
||||||
podman-compose --env-file=stack.env build
|
docker-compose --env-file=stack.env build
|
||||||
|
|
||||||
stop:
|
stop:
|
||||||
podman-compose --env-file=stack.env down
|
docker-compose --env-file=stack.env down
|
||||||
|
|
||||||
log:
|
log:
|
||||||
podman-compose --env-file=stack.env logs -f
|
docker-compose --env-file=stack.env logs -f
|
||||||
|
|
||||||
test:
|
test:
|
||||||
podman-compose --env-file=stack.env run -e LIVE=$(LIVE) --rm app sh -c ". /venv/bin/activate && python manage.py test $(MODULES) -v 2"
|
docker-compose --env-file=stack.env run -e LIVE=$(LIVE) --rm app sh -c ". /venv/bin/activate && python manage.py test $(MODULES) -v 2"
|
||||||
|
|
||||||
migrate:
|
migrate:
|
||||||
podman-compose --env-file=stack.env run --rm app sh -c ". /venv/bin/activate && python manage.py migrate"
|
docker-compose --env-file=stack.env run --rm app sh -c ". /venv/bin/activate && python manage.py migrate"
|
||||||
|
|
||||||
makemigrations:
|
makemigrations:
|
||||||
podman-compose --env-file=stack.env run --rm app sh -c ". /venv/bin/activate && python manage.py makemigrations"
|
docker-compose --env-file=stack.env run --rm app sh -c ". /venv/bin/activate && python manage.py makemigrations"
|
||||||
|
|
||||||
auth:
|
auth:
|
||||||
podman-compose --env-file=stack.env run --rm app sh -c ". /venv/bin/activate && python manage.py createsuperuser"
|
docker-compose --env-file=stack.env run --rm app sh -c ". /venv/bin/activate && python manage.py createsuperuser"
|
||||||
|
|
||||||
token:
|
token:
|
||||||
podman-compose --env-file=stack.env run --rm app sh -c ". /venv/bin/activate && python manage.py addstatictoken m"
|
docker-compose --env-file=stack.env run --rm app sh -c ". /venv/bin/activate && python manage.py addstatictoken m"
|
||||||
|
|
|
@ -57,20 +57,18 @@ INSTALLED_APPS = [
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
# Performance optimisations # COMMENTED DUE TO PODMAN ISSUE
|
# Performance optimisations
|
||||||
# CACHES = {
|
CACHES = {
|
||||||
# "default": {
|
"default": {
|
||||||
# "BACKEND": "django.core.cache.backends.redis.RedisCache",
|
"BACKEND": "django.core.cache.backends.redis.RedisCache",
|
||||||
# "LOCATION": "unix:///var/run/socks/redis.sock",
|
"LOCATION": "unix:///var/run/socks/redis.sock",
|
||||||
# "OPTIONS": {
|
"OPTIONS": {
|
||||||
# "db": "10",
|
"db": "10",
|
||||||
# "parser_class": "redis.connection.HiredisParser",
|
"parser_class": "redis.connection.HiredisParser",
|
||||||
# "pool_class": "redis.BlockingConnectionPool",
|
"pool_class": "redis.BlockingConnectionPool",
|
||||||
# },
|
},
|
||||||
# }
|
}
|
||||||
# }
|
}
|
||||||
# END PODMAN ISSUE
|
|
||||||
|
|
||||||
# CACHE_MIDDLEWARE_ALIAS = 'default'
|
# CACHE_MIDDLEWARE_ALIAS = 'default'
|
||||||
# CACHE_MIDDLEWARE_SECONDS = '600'
|
# CACHE_MIDDLEWARE_SECONDS = '600'
|
||||||
# CACHE_MIDDLEWARE_KEY_PREFIX = ''
|
# CACHE_MIDDLEWARE_KEY_PREFIX = ''
|
||||||
|
|
|
@ -1,6 +1,14 @@
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
import stripe
|
||||||
|
from django.conf import settings
|
||||||
|
|
||||||
os.environ["DJANGO_ALLOW_ASYNC_UNSAFE"] = "true"
|
os.environ["DJANGO_ALLOW_ASYNC_UNSAFE"] = "true"
|
||||||
# from redis import StrictRedis
|
# from redis import StrictRedis
|
||||||
|
|
||||||
# r = StrictRedis(unix_socket_path="/var/run/redis/redis.sock", db=0)
|
# r = StrictRedis(unix_socket_path="/var/run/redis/redis.sock", db=0)
|
||||||
|
|
||||||
|
if settings.STRIPE_TEST:
|
||||||
|
stripe.api_key = settings.STRIPE_API_KEY_TEST
|
||||||
|
else:
|
||||||
|
stripe.api_key = settings.STRIPE_API_KEY_PROD
|
||||||
|
|
|
@ -1,16 +1,10 @@
|
||||||
import stripe
|
import stripe
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
from lago_python_client import Client
|
||||||
# from lago_python_client import Client
|
from lago_python_client.clients.base_client import LagoApiError
|
||||||
from lago_python_client.client import Client
|
|
||||||
from lago_python_client.exceptions import LagoApiError
|
|
||||||
from lago_python_client.models import Customer, CustomerBillingConfiguration
|
from lago_python_client.models import Customer, CustomerBillingConfiguration
|
||||||
|
|
||||||
client = Client(api_key=settings.LAGO_API_KEY, api_url=settings.LAGO_URL)
|
client = Client(api_key=settings.LAGO_API_KEY, api_url=settings.LAGO_URL)
|
||||||
if settings.STRIPE_TEST:
|
|
||||||
stripe.api_key = settings.STRIPE_API_KEY_TEST
|
|
||||||
else:
|
|
||||||
stripe.api_key = settings.STRIPE_API_KEY_PROD
|
|
||||||
|
|
||||||
|
|
||||||
def expand_name(first_name, last_name):
|
def expand_name(first_name, last_name):
|
||||||
|
|
|
@ -412,7 +412,6 @@ def execute_strategy(callback, strategy, func):
|
||||||
direction=direction,
|
direction=direction,
|
||||||
**protection,
|
**protection,
|
||||||
)
|
)
|
||||||
log.debug(f"Created Trade: {new_trade}")
|
|
||||||
new_trade.save()
|
new_trade.save()
|
||||||
|
|
||||||
if strategy.risk_model is not None:
|
if strategy.risk_model is not None:
|
||||||
|
|
|
@ -17,8 +17,8 @@ services:
|
||||||
# - "8000:8000" # uwsgi socket
|
# - "8000:8000" # uwsgi socket
|
||||||
env_file:
|
env_file:
|
||||||
- stack.env
|
- stack.env
|
||||||
# volumes_from:
|
volumes_from:
|
||||||
# - tmp
|
- tmp
|
||||||
depends_on:
|
depends_on:
|
||||||
# redis:
|
# redis:
|
||||||
# condition: service_healthy
|
# condition: service_healthy
|
||||||
|
@ -46,11 +46,11 @@ services:
|
||||||
- fisk_static:${STATIC_ROOT}
|
- fisk_static:${STATIC_ROOT}
|
||||||
env_file:
|
env_file:
|
||||||
- stack.env
|
- stack.env
|
||||||
# volumes_from:
|
volumes_from:
|
||||||
# - tmp
|
- tmp
|
||||||
depends_on:
|
depends_on:
|
||||||
# redis:
|
redis:
|
||||||
# condition: service_healthy
|
condition: service_healthy
|
||||||
migration:
|
migration:
|
||||||
condition: service_started
|
condition: service_started
|
||||||
collectstatic:
|
collectstatic:
|
||||||
|
@ -72,8 +72,8 @@ services:
|
||||||
- ${PORTAINER_GIT_DIR}:/code
|
- ${PORTAINER_GIT_DIR}:/code
|
||||||
- ${APP_DATABASE_FILE}:/conf/db.sqlite3
|
- ${APP_DATABASE_FILE}:/conf/db.sqlite3
|
||||||
- fisk_static:${STATIC_ROOT}
|
- fisk_static:${STATIC_ROOT}
|
||||||
# volumes_from:
|
volumes_from:
|
||||||
# - tmp
|
- tmp
|
||||||
env_file:
|
env_file:
|
||||||
- stack.env
|
- stack.env
|
||||||
|
|
||||||
|
@ -89,27 +89,27 @@ services:
|
||||||
- ${PORTAINER_GIT_DIR}:/code
|
- ${PORTAINER_GIT_DIR}:/code
|
||||||
- ${APP_DATABASE_FILE}:/conf/db.sqlite3
|
- ${APP_DATABASE_FILE}:/conf/db.sqlite3
|
||||||
- fisk_static:${STATIC_ROOT}
|
- fisk_static:${STATIC_ROOT}
|
||||||
# volumes_from:
|
volumes_from:
|
||||||
# - tmp
|
- tmp
|
||||||
env_file:
|
env_file:
|
||||||
- stack.env
|
- stack.env
|
||||||
|
|
||||||
nginx:
|
nginx:
|
||||||
image: nginxinc/nginx-unprivileged:latest
|
image: nginx:latest
|
||||||
container_name: nginx_fisk
|
container_name: nginx_fisk
|
||||||
ports:
|
ports:
|
||||||
- ${APP_PORT}:9999
|
- ${APP_PORT}:9999
|
||||||
# ulimits:
|
ulimits:
|
||||||
# nproc: 65535
|
nproc: 65535
|
||||||
# nofile:
|
nofile:
|
||||||
# soft: 65535
|
soft: 65535
|
||||||
# hard: 65535
|
hard: 65535
|
||||||
volumes:
|
volumes:
|
||||||
- ${PORTAINER_GIT_DIR}:/code
|
- ${PORTAINER_GIT_DIR}:/code
|
||||||
- ${PORTAINER_GIT_DIR}/docker/nginx/conf.d/${OPERATION}.conf:/etc/nginx/conf.d/default.conf
|
- ${PORTAINER_GIT_DIR}/docker/nginx/conf.d/${OPERATION}.conf:/etc/nginx/conf.d/default.conf
|
||||||
- fisk_static:${STATIC_ROOT}
|
- fisk_static:${STATIC_ROOT}
|
||||||
# volumes_from:
|
volumes_from:
|
||||||
# - tmp
|
- tmp
|
||||||
networks:
|
networks:
|
||||||
- default
|
- default
|
||||||
- xf
|
- xf
|
||||||
|
@ -124,36 +124,33 @@ services:
|
||||||
# redis:
|
# redis:
|
||||||
# condition: service_healthy
|
# condition: service_healthy
|
||||||
|
|
||||||
# tmp:
|
tmp:
|
||||||
# image: busybox
|
image: busybox
|
||||||
# container_name: tmp_fisk
|
container_name: tmp_fisk
|
||||||
# command: chmod -R 777 /var/run/socks
|
command: chmod -R 777 /var/run/socks
|
||||||
# volumes:
|
volumes:
|
||||||
# - /var/run/socks
|
- /var/run/socks
|
||||||
|
|
||||||
# # For caching
|
# For caching
|
||||||
# redis:
|
redis:
|
||||||
# image: redis
|
image: redis
|
||||||
# container_name: redis_fisk
|
container_name: redis_fisk
|
||||||
# command: redis-server /etc/redis.conf
|
command: redis-server /etc/redis.conf
|
||||||
# #ulimits:
|
ulimits:
|
||||||
# # nproc: 65535
|
nproc: 65535
|
||||||
# # nofile:
|
nofile:
|
||||||
# # soft: 65535
|
soft: 65535
|
||||||
# # hard: 65535
|
hard: 65535
|
||||||
# volumes:
|
volumes:
|
||||||
# - ${PORTAINER_GIT_DIR}/docker/redis.conf:/etc/redis.conf
|
- ${PORTAINER_GIT_DIR}/docker/redis.conf:/etc/redis.conf
|
||||||
# - fisk_redis_data:/data
|
- fisk_redis_data:/data
|
||||||
# volumes_from:
|
volumes_from:
|
||||||
# - tmp
|
- tmp
|
||||||
# healthcheck:
|
healthcheck:
|
||||||
# test: "redis-cli -s /var/run/socks/redis.sock ping"
|
test: "redis-cli -s /var/run/socks/redis.sock ping"
|
||||||
# interval: 2s
|
interval: 2s
|
||||||
# timeout: 2s
|
timeout: 2s
|
||||||
# retries: 15
|
retries: 15
|
||||||
# depends_on:
|
|
||||||
# tmp:
|
|
||||||
# condition: service_started
|
|
||||||
|
|
||||||
# pyroscope:
|
# pyroscope:
|
||||||
# image: "pyroscope/pyroscope:latest"
|
# image: "pyroscope/pyroscope:latest"
|
||||||
|
|
Loading…
Reference in New Issue