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: run:
docker-compose --env-file=stack.env up -d docker-compose -f docker-compose.dev.yml --env-file=stack.env up -d
build: build:
docker-compose --env-file=stack.env build docker-compose -f docker-compose.dev.yml --env-file=stack.env build
stop: stop:
docker-compose --env-file=stack.env down docker-compose -f docker-compose.dev.yml --env-file=stack.env down
log: log:
docker-compose --env-file=stack.env logs -f docker-compose -f docker-compose.dev.yml --env-file=stack.env logs -f
test: 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: 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: 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: 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: 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 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.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)

View File

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

View File

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