Fix development

This commit is contained in:
Mark Veidemanis 2023-08-10 17:11:40 +00:00
parent aca9897f44
commit a68ade9efe
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
4 changed files with 53 additions and 51 deletions

View File

@ -1,26 +1,26 @@
run:
docker-compose --env-file=stack.env up -d
docker-compose -f docker-compose.dev.yml --env-file=stack.env up -d
build:
docker-compose --env-file=stack.env build
docker-compose -f docker-compose.dev.yml --env-file=stack.env build
stop:
docker-compose --env-file=stack.env down
docker-compose -f docker-compose.dev.yml --env-file=stack.env down
log:
docker-compose --env-file=stack.env logs -f
docker-compose -f docker-compose.dev.yml --env-file=stack.env logs -f
test:
docker-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 -f docker-compose.dev.yml --env-file=stack.env run -e LIVE=$(LIVE) --rm app_dev sh -c ". /venv/bin/activate && python manage.py test $(MODULES) -v 2"
migrate:
docker-compose --env-file=stack.env run --rm app sh -c ". /venv/bin/activate && python manage.py migrate"
docker-compose -f docker-compose.dev.yml --env-file=stack.env run --rm app_dev sh -c ". /venv/bin/activate && python manage.py migrate"
makemigrations:
docker-compose --env-file=stack.env run --rm app sh -c ". /venv/bin/activate && python manage.py makemigrations"
docker-compose -f docker-compose.dev.yml --env-file=stack.env run --rm app_dev sh -c ". /venv/bin/activate && python manage.py makemigrations"
auth:
docker-compose --env-file=stack.env run --rm app sh -c ". /venv/bin/activate && python manage.py createsuperuser"
docker-compose -f docker-compose.dev.yml --env-file=stack.env run --rm app_dev sh -c ". /venv/bin/activate && python manage.py createsuperuser"
token:
docker-compose --env-file=stack.env run --rm app sh -c ". /venv/bin/activate && python manage.py addstatictoken m"
docker-compose -f docker-compose.dev.yml --env-file=stack.env run --rm app_dev sh -c ". /venv/bin/activate && python manage.py addstatictoken m"

View File

@ -1,7 +1,7 @@
import stripe
from django.conf import settings
from lago_python_client import Client
from lago_python_client.clients.base_client import LagoApiError
from lago_python_client.exceptions import LagoApiError
from lago_python_client.models import Customer, CustomerBillingConfiguration
client = Client(api_key=settings.LAGO_API_KEY, api_url=settings.LAGO_URL)

View File

@ -1,9 +1,11 @@
version: "2.2"
version: "3.8"
name: fisk_dev
services:
app:
image: xf/fisk:prod
container_name: fisk
app_dev:
image: xf/fisk:dev
container_name: fisk_dev
build:
context: .
args:
@ -12,28 +14,28 @@ services:
- ${PORTAINER_GIT_DIR}:/code
- ${PORTAINER_GIT_DIR}/docker/uwsgi.ini:/conf/uwsgi.ini
- ${APP_DATABASE_FILE}:/conf/db.sqlite3
- fisk_static:${STATIC_ROOT}
- fisk_static_dev:${STATIC_ROOT}
#ports:
# - "8000:8000" # uwsgi socket
env_file:
- stack.env
volumes_from:
- tmp
- tmp_dev
depends_on:
# redis:
# condition: service_healthy
migration:
migration_dev:
condition: service_started
collectstatic:
collectstatic_dev:
condition: service_started
networks:
- default
- xf
- elastic
scheduling:
image: xf/fisk:prod
container_name: scheduling_fisk
scheduling_dev:
image: xf/fisk:dev
container_name: scheduling_fisk_dev
build:
context: .
args:
@ -43,26 +45,26 @@ services:
- ${PORTAINER_GIT_DIR}:/code
- ${PORTAINER_GIT_DIR}/docker/uwsgi.ini:/conf/uwsgi.ini
- ${APP_DATABASE_FILE}:/conf/db.sqlite3
- fisk_static:${STATIC_ROOT}
- fisk_static_dev:${STATIC_ROOT}
env_file:
- stack.env
volumes_from:
- tmp
- tmp_dev
depends_on:
redis:
redis_dev:
condition: service_healthy
migration:
migration_dev:
condition: service_started
collectstatic:
collectstatic_dev:
condition: service_started
networks:
- default
- xf
- elastic
migration:
image: xf/fisk:prod
container_name: migration_fisk
migration_dev:
image: xf/fisk:dev
container_name: migration_fisk_dev
build:
context: .
args:
@ -71,15 +73,15 @@ services:
volumes:
- ${PORTAINER_GIT_DIR}:/code
- ${APP_DATABASE_FILE}:/conf/db.sqlite3
- fisk_static:${STATIC_ROOT}
- fisk_static_dev:${STATIC_ROOT}
volumes_from:
- tmp
- tmp_dev
env_file:
- stack.env
collectstatic:
image: xf/fisk:prod
container_name: collectstatic_fisk
collectstatic_dev:
image: xf/fisk:dev
container_name: collectstatic_fisk_dev
build:
context: .
args:
@ -88,15 +90,15 @@ services:
volumes:
- ${PORTAINER_GIT_DIR}:/code
- ${APP_DATABASE_FILE}:/conf/db.sqlite3
- fisk_static:${STATIC_ROOT}
- fisk_static_dev:${STATIC_ROOT}
volumes_from:
- tmp
- tmp_dev
env_file:
- stack.env
nginx:
nginx_dev:
image: nginx:latest
container_name: nginx_fisk
container_name: nginx_fisk_dev
ports:
- ${APP_PORT}:9999
ulimits:
@ -107,14 +109,14 @@ services:
volumes:
- ${PORTAINER_GIT_DIR}:/code
- ${PORTAINER_GIT_DIR}/docker/nginx/conf.d/${OPERATION}.conf:/etc/nginx/conf.d/default.conf
- fisk_static:${STATIC_ROOT}
- fisk_static_dev:${STATIC_ROOT}
volumes_from:
- tmp
- tmp_dev
networks:
- default
- xf
depends_on:
app:
app_dev:
condition: service_started
@ -124,17 +126,17 @@ services:
# redis:
# condition: service_healthy
tmp:
tmp_dev:
image: busybox
container_name: tmp_fisk
container_name: tmp_fisk_dev
command: chmod -R 777 /var/run/socks
volumes:
- /var/run/socks
# For caching
redis:
redis_dev:
image: redis
container_name: redis_fisk
container_name: redis_fisk_dev
command: redis-server /etc/redis.conf
ulimits:
nproc: 65535
@ -143,9 +145,9 @@ services:
hard: 65535
volumes:
- ${PORTAINER_GIT_DIR}/docker/redis.conf:/etc/redis.conf
- fisk_redis_data:/data
- fisk_redis_data_dev:/data
volumes_from:
- tmp
- tmp_dev
healthcheck:
test: "redis-cli -s /var/run/socks/redis.sock ping"
interval: 2s
@ -168,5 +170,5 @@ networks:
external: true
volumes:
fisk_static: {}
fisk_redis_data: {}
fisk_static_dev: {}
fisk_redis_data_dev: {}

View File

@ -1,7 +1,7 @@
upstream django {
#server app:8000;
#server unix:///var/run/socks/app.sock;
server app:8000;
server app_dev:8000; # won't work in production mode
}
server {