mirror of
https://github.com/Reckless-Satoshi/robosats.git
synced 2024-09-11 11:55:26 +03:00
Serve statics into dev/prod
This commit is contained in:
parent
f830c4df15
commit
3eff1f38ff
@ -1,3 +1,4 @@
|
||||
import os
|
||||
from re import T
|
||||
from django.db.models import query
|
||||
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.models import User
|
||||
from django.conf import settings as conf_settings
|
||||
|
||||
from .serializers import ListOrderSerializer, MakeOrderSerializer, UpdateOrderSerializer
|
||||
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'))
|
||||
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)
|
||||
|
||||
# Create your views here.
|
||||
|
@ -9,7 +9,7 @@ services:
|
||||
networks:
|
||||
- redis_network
|
||||
|
||||
robosats:
|
||||
backend:
|
||||
build: .
|
||||
container_name: rs-dev
|
||||
restart: always
|
||||
@ -25,8 +25,10 @@ services:
|
||||
- nginx_network
|
||||
- redis_network
|
||||
command: python3 manage.py runserver
|
||||
ports:
|
||||
- 8000:8000
|
||||
|
||||
npm:
|
||||
frontend:
|
||||
build: ./frontend
|
||||
container_name: npm-dev
|
||||
restart: always
|
||||
@ -36,7 +38,7 @@ services:
|
||||
- nginx_network
|
||||
- redis_network
|
||||
|
||||
clean-orders-testnet:
|
||||
clean-orders:
|
||||
build: ./robosats
|
||||
restart: always
|
||||
container_name: clord-dev
|
||||
@ -44,7 +46,7 @@ services:
|
||||
volumes:
|
||||
- ./robosats/:/usr/src/robosats
|
||||
|
||||
follow-invoices-testnet:
|
||||
follow-invoices:
|
||||
build: ./robosats
|
||||
container_name: invo-dev
|
||||
restart: always
|
||||
@ -53,9 +55,9 @@ services:
|
||||
# - lnd-testnet
|
||||
command: python3 manage.py follow_invoices
|
||||
volumes:
|
||||
- /mnt/database:/usr/src/database
|
||||
- /mnt/dev/database:/usr/src/database
|
||||
|
||||
celery-beat-testnet:
|
||||
celery:
|
||||
build: ./robosats
|
||||
container_name: cbeat-dev
|
||||
restart: always
|
||||
@ -63,7 +65,7 @@ services:
|
||||
environment:
|
||||
REDIS_URL: redis://redis:6379
|
||||
volumes:
|
||||
- /mnt/database:/usr/src/database
|
||||
- /mnt/dev/database:/usr/src/database
|
||||
depends_on:
|
||||
- redis
|
||||
networks:
|
||||
@ -71,7 +73,6 @@ services:
|
||||
|
||||
volumes:
|
||||
redisdata:
|
||||
static-content:
|
||||
|
||||
networks:
|
||||
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
|
||||
|
||||
STATIC_URL = '/static/'
|
||||
STATIC_ROOT = os.path.join(BASE_DIR, 'frontend/static/')
|
||||
|
||||
# Quick-start development settings - unsuitable for production
|
||||
# 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
|
||||
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!
|
||||
if os.environ.get('DEVELOPMENT'):
|
||||
|
Loading…
Reference in New Issue
Block a user