Skip to content

Commit

Permalink
fix issues with smaller docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptosharks131 committed Sep 24, 2024
1 parent 065c87f commit 11aa6f8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
RUN pip install supervisor whitenoise
2 changes: 2 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions initialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 11aa6f8

Please sign in to comment.