diff --git a/Dockerfile b/Dockerfile index ff62af61..b3e04f34 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,5 +4,4 @@ RUN apk add git g++ linux-headers && git clone https://github.com/cryptosharks13 WORKDIR /app RUN git checkout "master" RUN pip install -r requirements.txt -RUN pip install whitenoise -ENTRYPOINT [ "sh" ] \ No newline at end of file +RUN pip install supervisor whitenoise \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml index b672c131..a51e3d2e 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -4,7 +4,9 @@ services: volumes: - /root/.lnd:/root/.lnd:ro - /root/lndg/data:/app/data:rw + - /root/lndg/data/lndg-controller.log:/var/log/lndg-controller.log:rw command: + - sh - -c - python initialize.py -net 'mainnet' -rpc 'localhost:10009' -wn && python controller.py runserver 0.0.0.0:8000 > /var/log/lndg-controller.log 2>&1 ports: diff --git a/initialize.py b/initialize.py index a4e7386f..b2ff07ec 100644 --- a/initialize.py +++ b/initialize.py @@ -217,12 +217,12 @@ def write_supervisord_settings(sduser): stdout_logfile = /var/log/lndg-controller.log stdout_logfile_maxbytes = 150MB stdout_logfile_backups = 15 -''' % (sduser, supervisord_secret, supervisord_secret, BASE_DIR, BASE_DIR) - if Path("/usr/local/etc/supervisord.conf").exists(): +''' % (sduser, supervisord_secret, supervisord_secret, BASE_DIR) + if Path("/usr/local/supervisord.conf").exists(): print('A supervisord settings file already exist, skipping creation...') return try: - with open("/usr/local/etc/supervisord.conf", "w") as f: + with open("/usr/local/supervisord.conf", "w") as f: f.write(supervisord_settings_file) except Exception as e: print('Error creating the settings file: ', str(e))