Working docker-compose

This commit is contained in:
Reckless_Satoshi 2022-02-07 10:11:57 -08:00
parent de702d19ac
commit 470393f2a0
No known key found for this signature in database
GPG Key ID: 9C4585B561315571
4 changed files with 35 additions and 34 deletions

View File

@ -11,20 +11,21 @@ services:
backend:
build: .
container_name: rs-dev
container_name: django-dev
restart: always
depends_on:
# - bitcoind-dev
# - lnd-dev
- redis
environment:
DEVELOPMENT: True
DEVELOPMENT: 1
volumes:
- ./robosats/:/usr/src/robosats
- .:/usr/src/robosats
- /mnt/development/database:/usr/src/database
networks:
- nginx_network
- redis_network
command: python3 manage.py runserver
command: python3 manage.py runserver 0.0.0.0:8000
ports:
- 8000:8000
@ -33,21 +34,22 @@ services:
container_name: npm-dev
restart: always
volumes:
- ./robosats/:/usr/src/robosats
- .:/usr/src/robosats
networks:
- nginx_network
- redis_network
clean-orders:
build: ./robosats
build: .
restart: always
container_name: clord-dev
command: python3 manage.py clean-orders-testnet
command: python3 manage.py clean_orders
volumes:
- ./robosats/:/usr/src/robosats
- .:/usr/src/robosats
- /mnt/development/database:/usr/src/database
follow-invoices:
build: ./robosats
build: .
container_name: invo-dev
restart: always
# depends_on:
@ -55,17 +57,19 @@ services:
# - lnd-testnet
command: python3 manage.py follow_invoices
volumes:
- /mnt/dev/database:/usr/src/database
- .:/usr/src/robosats
- /mnt/development/database:/usr/src/database
celery:
build: ./robosats
build: .
container_name: cbeat-dev
restart: always
command: celery -A robosats worker --beat -l info -S django
environment:
REDIS_URL: redis://redis:6379
volumes:
- /mnt/dev/database:/usr/src/database
- .:/usr/src/robosats
- /mnt/development/database:/usr/src/database
depends_on:
- redis
networks:

View File

@ -1,24 +1,23 @@
FROM alpine
FROM ubuntu:20.04
ARG DEBIAN_FRONTEND=noninteractive
RUN mkdir -p /usr/src/robosats/frontend
RUN mkdir -p /usr/src/frontend
# specifying the working dir inside the container
WORKDIR /usr/src/robosats/frontend
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
WORKDIR /usr/src/frontend
# copy current dir's content to container's WORKDIR root i.e. all the contents of the robosats app
COPY . .
RUN apt install RUN
RUN apt update
RUN apt -y install npm
# packages we use
RUN npm init -y
RUN npm i webpack webpack-cli --save-dev
RUN npm i @babel/core babel-loader @babel/preset-env @babel/preset-react --save-dev
RUN npm i react react-dom --save-dev
RUN npm install webpack webpack-cli --save-dev
RUN npm install @babel/core babel-loader @babel/preset-env @babel/preset-react --save-dev
RUN npm install react react-dom --save-dev
RUN npm install @material-ui/core
RUN npm install @babel/plugin-proposal-class-properties
RUN npm install react-router-dom@5.2.0

View File

@ -101,18 +101,6 @@ DATABASES = {
}
}
if os.environ.get('DEVELOPMENT'):
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
'OPTIONS': {
'timeout': 20, # in seconds
}
}
}
# Password validation
# https://docs.djangoproject.com/en/4.0/ref/settings/#auth-password-validators

View File

@ -218,3 +218,13 @@ Then launch it with
systemctl start clean_orders
systemctl enable clean_orders
```
# Docker set up for development, example for testnet (-dev containers)
```
docker-compose build --no-cache
docker-compose up
sudo docker exec -it rs-dev python3 manage.py makemigrations
sudo docker exec -it rs-dev python3 manage.py migrate
sudo docker exec -it rs-dev python3 manage.py createsuperuser
docker-compose restart
```