Skip to content

Commit

Permalink
Docker composed service: fix bug with MySQL server - change to MariaDB;)
Browse files Browse the repository at this point in the history
  • Loading branch information
onegreyonewhite committed Aug 28, 2018
1 parent 4f8eec2 commit 31f5833
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
14 changes: 6 additions & 8 deletions docker-compose-testrun.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3'
services:
db-server:
image: mysql:latest
image: mariadb:latest
environment:
- MYSQL_DATABASE=polemarch
- MYSQL_ROOT_PASSWORD=polemarch
Expand All @@ -22,14 +22,12 @@ services:
command: |
/bin/bash -c "
set -e
curl https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh | tee ./wait-for-it.sh
chmod +x wait-for-it.sh
./wait-for-it.sh db-server:3306 -s -t 30
./wait-for-it.sh redis-server:6379 -s -t 30
mkdir -p /var/run/polemarch
/opt/polemarch/bin/polemarchctl migrate
/opt/polemarch/bin/uwsgi /opt/polemarch/lib/python2.7/site-packages/polemarch/web.ini
/usr/bin/wait-for-it.sh db-server:3306 -s -t 120
/usr/bin/wait-for-it.sh redis-server:6379 -s -t 120
mkdir -p /var/run/polemarch /var/log/polemarch
cat /etc/polemarch/settings.ini
/opt/polemarch/bin/polemarchctl migrate
/opt/polemarch/bin/polemarchctl webserver
/bin/bash || exit 0
"
external_links:
Expand Down
1 change: 1 addition & 0 deletions docker/Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ RUN mkdir /tmp/polemarch
ADD . /tmp/polemarch/
RUN cd /tmp/polemarch && tox -e build && \
/opt/polemarch/bin/pip install /tmp/polemarch/dist/*.tar.gz && \
rm -rf /tmp/polemarch/dist /tmp/polemarch/.tox && \
mkdir -p /etc/polemarch/ && \
cp -vf /tmp/polemarch/test_settings.ini /etc/polemarch/settings.ini

Expand Down
7 changes: 3 additions & 4 deletions test_settings.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ host = db-server
port = 3306

[database.options]
# init_command = SET sql_mode='STRICT_TRANS_TABLES', default_storage_engine=INNODB
init_command = SET sql_mode='STRICT_TRANS_TABLES', default_storage_engine=INNODB, NAMES 'utf8', CHARACTER SET 'utf8', SESSION collation_connection = 'utf8_unicode_ci'

[cache]
Expand All @@ -35,10 +34,10 @@ rest_page_limit = 100
# Main settings
processes = 4
threads = 4
harakiri = 30
harakiri = 120
vacuum = True
daemon = false

# Celery from start
hook-pre-app = exec: /opt/polemarch/bin/celery multi start worker -A polemarchplus.wapp:app -B -f /var/log/polemarch/worker.log -l WARNING --pidfile=/var/run/polemarch/worker.pid
hook-as-user-atexit = exec: /opt/polemarch/bin/celery multi stop worker -A polemarchplus.wapp:app -B -f /var/log/polemarch/worker.log -l WARNING --pidfile=/var/run/polemarch/worker.pid
hook-pre-app = exec: /opt/polemarch/bin/celery multi start worker -A polemarch.wapp:app -B -f /var/log/polemarch/worker.log -l WARNING --pidfile=/var/run/polemarch/worker.pid
hook-as-user-atexit = exec: /opt/polemarch/bin/celery multi stop worker -A polemarch.wapp:app -B -f /var/log/polemarch/worker.log -l WARNING --pidfile=/var/run/polemarch/worker.pid

0 comments on commit 31f5833

Please sign in to comment.