mirror of
https://github.com/RoboSats/robosats.git
synced 2025-07-21 18:23:34 +00:00
Serve statics into dev/prod
This commit is contained in:
@ -1,3 +1,4 @@
|
|||||||
|
import os
|
||||||
from re import T
|
from re import T
|
||||||
from django.db.models import query
|
from django.db.models import query
|
||||||
from rest_framework import status, viewsets
|
from rest_framework import status, viewsets
|
||||||
@ -7,7 +8,6 @@ from rest_framework.response import Response
|
|||||||
|
|
||||||
from django.contrib.auth import authenticate, login, logout
|
from django.contrib.auth import authenticate, login, logout
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
from django.conf import settings as conf_settings
|
|
||||||
|
|
||||||
from .serializers import ListOrderSerializer, MakeOrderSerializer, UpdateOrderSerializer
|
from .serializers import ListOrderSerializer, MakeOrderSerializer, UpdateOrderSerializer
|
||||||
from .models import LNPayment, MarketTick, Order, Currency
|
from .models import LNPayment, MarketTick, Order, Currency
|
||||||
@ -29,8 +29,11 @@ EXP_MAKER_BOND_INVOICE = int(config('EXP_MAKER_BOND_INVOICE'))
|
|||||||
FEE = float(config('FEE'))
|
FEE = float(config('FEE'))
|
||||||
RETRY_TIME = int(config('RETRY_TIME'))
|
RETRY_TIME = int(config('RETRY_TIME'))
|
||||||
|
|
||||||
avatar_path = Path(conf_settings.STATIC_ROOT,'/assets/avatars')
|
|
||||||
print(str(avatar_path))
|
avatar_path = Path('/usr/src/static/assets/avatars')
|
||||||
|
if os.environ.get('DEVELOPMENT'):
|
||||||
|
avatar_path = Path('frontend/static/assets/avatars')
|
||||||
|
|
||||||
avatar_path.mkdir(parents=True, exist_ok=True)
|
avatar_path.mkdir(parents=True, exist_ok=True)
|
||||||
|
|
||||||
# Create your views here.
|
# Create your views here.
|
||||||
|
@ -9,7 +9,7 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- redis_network
|
- redis_network
|
||||||
|
|
||||||
robosats:
|
backend:
|
||||||
build: .
|
build: .
|
||||||
container_name: rs-dev
|
container_name: rs-dev
|
||||||
restart: always
|
restart: always
|
||||||
@ -25,8 +25,10 @@ services:
|
|||||||
- nginx_network
|
- nginx_network
|
||||||
- redis_network
|
- redis_network
|
||||||
command: python3 manage.py runserver
|
command: python3 manage.py runserver
|
||||||
|
ports:
|
||||||
|
- 8000:8000
|
||||||
|
|
||||||
npm:
|
frontend:
|
||||||
build: ./frontend
|
build: ./frontend
|
||||||
container_name: npm-dev
|
container_name: npm-dev
|
||||||
restart: always
|
restart: always
|
||||||
@ -36,7 +38,7 @@ services:
|
|||||||
- nginx_network
|
- nginx_network
|
||||||
- redis_network
|
- redis_network
|
||||||
|
|
||||||
clean-orders-testnet:
|
clean-orders:
|
||||||
build: ./robosats
|
build: ./robosats
|
||||||
restart: always
|
restart: always
|
||||||
container_name: clord-dev
|
container_name: clord-dev
|
||||||
@ -44,7 +46,7 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- ./robosats/:/usr/src/robosats
|
- ./robosats/:/usr/src/robosats
|
||||||
|
|
||||||
follow-invoices-testnet:
|
follow-invoices:
|
||||||
build: ./robosats
|
build: ./robosats
|
||||||
container_name: invo-dev
|
container_name: invo-dev
|
||||||
restart: always
|
restart: always
|
||||||
@ -53,9 +55,9 @@ services:
|
|||||||
# - lnd-testnet
|
# - lnd-testnet
|
||||||
command: python3 manage.py follow_invoices
|
command: python3 manage.py follow_invoices
|
||||||
volumes:
|
volumes:
|
||||||
- /mnt/database:/usr/src/database
|
- /mnt/dev/database:/usr/src/database
|
||||||
|
|
||||||
celery-beat-testnet:
|
celery:
|
||||||
build: ./robosats
|
build: ./robosats
|
||||||
container_name: cbeat-dev
|
container_name: cbeat-dev
|
||||||
restart: always
|
restart: always
|
||||||
@ -63,7 +65,7 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
REDIS_URL: redis://redis:6379
|
REDIS_URL: redis://redis:6379
|
||||||
volumes:
|
volumes:
|
||||||
- /mnt/database:/usr/src/database
|
- /mnt/dev/database:/usr/src/database
|
||||||
depends_on:
|
depends_on:
|
||||||
- redis
|
- redis
|
||||||
networks:
|
networks:
|
||||||
@ -71,7 +73,6 @@ services:
|
|||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
redisdata:
|
redisdata:
|
||||||
static-content:
|
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
nginx_network:
|
nginx_network:
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@ -18,7 +18,6 @@ from decouple import config
|
|||||||
BASE_DIR = Path(__file__).resolve().parent.parent
|
BASE_DIR = Path(__file__).resolve().parent.parent
|
||||||
|
|
||||||
STATIC_URL = '/static/'
|
STATIC_URL = '/static/'
|
||||||
STATIC_ROOT = os.path.join(BASE_DIR, 'frontend/static/')
|
|
||||||
|
|
||||||
# Quick-start development settings - unsuitable for production
|
# Quick-start development settings - unsuitable for production
|
||||||
# See https://docs.djangoproject.com/en/4.0/howto/deployment/checklist/
|
# See https://docs.djangoproject.com/en/4.0/howto/deployment/checklist/
|
||||||
@ -28,7 +27,7 @@ SECRET_KEY = 'django-insecure-6^&6uw$b5^en%(cu2kc7_o)(mgpazx#j_znwlym0vxfamn2uo-
|
|||||||
|
|
||||||
DEBUG = False
|
DEBUG = False
|
||||||
STATIC_URL = '/static/'
|
STATIC_URL = '/static/'
|
||||||
STATIC_ROOT = os.path.join('/usr/src/static/')
|
STATIC_ROOT ='/usr/src/static/'
|
||||||
|
|
||||||
# SECURITY WARNING: don't run with debug turned on in production!
|
# SECURITY WARNING: don't run with debug turned on in production!
|
||||||
if os.environ.get('DEVELOPMENT'):
|
if os.environ.get('DEVELOPMENT'):
|
||||||
|
Reference in New Issue
Block a user