docker: Add script container fragment.

Example:
python3 ./scripts/build_yml_files.py -c bitcoin monero dash pivx --withscript
This commit is contained in:
tecnovert
2023-03-09 15:32:54 +02:00
parent ea8cc70696
commit 484d811fe7
5 changed files with 41 additions and 10 deletions

View File

@@ -0,0 +1,23 @@
swapscript:
image: i_swapclient
build:
context: swapclient
dockerfile: Dockerfile
container_name: swapscript
volumes:
- ${DATA_PATH}/scripts:/data
environment:
- TZ
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "5"
depends_on:
- swapclient
restart: unless-stopped
command: ["/usr/bin/python3", "basicswap/scripts/createoffers.py",
"--host", "swapclient",
"--port", "${HTML_PORT}",
"--configfile", "/data/createoffers.json",
"--statefile", "/data/createoffers_state.json"]

View File

@@ -6,9 +6,12 @@
container_name: swapclient
volumes:
- ${DATA_PATH}/swapclient:/data
expose:
- "${HTML_PORT}"
- "${WS_PORT}"
ports:
- "${HTML_PORT}" # Expose only to localhost, see .env
- "${WS_PORT}" # Expose only to localhost, see .env
- "127.0.0.1:${HTML_PORT}:${HTML_PORT}" # Expose only to localhost
- "127.0.0.1:${WS_PORT}:${WS_PORT}" # Expose only to localhost
environment:
- TZ
logging: