docker: Set timezone in TZ env var.

This commit is contained in:
tecnovert 2021-02-14 15:06:46 +02:00
parent 3217918f7c
commit d6a1ff6030
No known key found for this signature in database
GPG key ID: 8ED6D8750C4E3F93
8 changed files with 21 additions and 6 deletions

View file

@ -5,7 +5,7 @@ ENV LANG=C.UTF-8 \
DATADIRS="/coindata"
RUN apt-get update; \
apt-get install -y wget python3-pip gnupg unzip protobuf-compiler automake libtool pkg-config gosu;
apt-get install -y wget python3-pip gnupg unzip protobuf-compiler automake libtool pkg-config gosu tzdata;
RUN wget -O coincurve-anonswap.zip https://github.com/tecnovert/coincurve/archive/anonswap.zip && \
unzip coincurve-anonswap.zip && \

View file

@ -715,6 +715,7 @@ class BasicSwap(BaseApp):
def start(self):
self.log.info('Starting BasicSwap %s, database v%d\n\n', __version__, self.db_version)
self.log.info('sqlalchemy version %s', sa.__version__)
self.log.info('timezone offset: %d (%s)', time.timezone, time.tzname[0])
self.upgradeDatabase(self.db_version)

View file

@ -13,12 +13,14 @@ Docker must be installed and started:
Should return a line containing `active (running)`
Create the images:
#### Create the images:
$ cd basicswap/docker
$ docker-compose build
Prepare the datadir:
#### Prepare the datadir:
Set XMR_RPC_HOST and BASE_XMR_RPC_PORT to a public XMR node or exclude to run a local node.
Set xmrrestoreheight to the current xmr chain height.
Adjust `--withcoins` and `--withoutcoins` as desired, eg: `--withcoins=monero,bitcoin`. By default only Particl is loaded.
@ -27,10 +29,16 @@ Adjust `--withcoins` and `--withoutcoins` as desired, eg: `--withcoins=monero,bi
$ docker run --rm -e XMR_RPC_HOST="node.xmr.to" -e BASE_XMR_RPC_PORT=18081 -t --name swap_prepare -v $COINDATA_PATH:/coindata i_swapclient \
basicswap-prepare --datadir=/coindata --withcoins=monero --htmlhost="0.0.0.0" --xmrrestoreheight=2245107
Record the mnemonic from the output of the above command.
**Record the mnemonic from the output of the above command.**
Start the container
#### Set the timezone:
Edit the `.env` file in the docker directory, set TZ to your local timezone.
Valid options can be listed with: `timedatectl list-timezones`
#### Start the container:
$ export COINDATA_PATH=/var/data/coinswaps
$ docker-compose up

View file

@ -1,2 +1,3 @@
HTML_PORT=127.0.0.1:12700:12700
#COINDATA_PATH=/var/data/coinswaps
TZ=UTC

View file

@ -10,6 +10,8 @@ services:
- ${COINDATA_PATH}:/coindata
ports:
- "${HTML_PORT}" # Expose only to localhost, see .env
environment:
- TZ
volumes:
coindata:

View file

@ -1 +1,2 @@
HTML_PORT=127.0.0.1:12700:12700
TZ=UTC

View file

@ -61,6 +61,8 @@ services:
- /var/swapdata/swapclient:/data
ports:
- "${HTML_PORT}" # Expose only to localhost, see .env
environment:
- TZ
depends_on:
- particl_core
restart: unless-stopped

View file

@ -5,7 +5,7 @@ ENV LANG=C.UTF-8 \
DATADIR=/data
RUN apt-get update; \
apt-get install -y wget python3-pip gnupg unzip protobuf-compiler automake libtool pkg-config gosu;
apt-get install -y wget python3-pip gnupg unzip protobuf-compiler automake libtool pkg-config gosu tzdata;
RUN wget -O coincurve-anonswap.zip https://github.com/tecnovert/coincurve/archive/anonswap.zip && \
unzip coincurve-anonswap.zip && \