mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2025-06-14 12:06:06 +00:00
Adjustment in Docker stuff to work with new migration. Add init_data.py script to initialize table data
This commit is contained in:
@ -1,11 +1,17 @@
|
||||
FROM ubuntu:latest
|
||||
MAINTAINER Khanh Ngo "ngokhanhit@gmail.com"
|
||||
MAINTAINER Khanh Ngo "k@ndk.name"
|
||||
ARG ENVIRONMENT=development
|
||||
ENV ENVIRONMENT=${ENVIRONMENT}
|
||||
|
||||
WORKDIR /powerdns-admin
|
||||
|
||||
RUN apt-get update -y
|
||||
|
||||
RUN apt-get install -y locales locales-all
|
||||
ENV LC_ALL en_US.UTF-8
|
||||
ENV LANG en_US.UTF-8
|
||||
ENV LANGUAGE en_US.UTF-8
|
||||
|
||||
RUN apt-get install -y python3-pip python3-dev supervisor
|
||||
|
||||
# lib for building mysql db driver
|
||||
|
@ -1,3 +1,14 @@
|
||||
#!/bin/sh
|
||||
cd /powerdns-admin && ./create_db.py
|
||||
|
||||
if [ ! -d "/powerdns-admin/migrations" ]; then
|
||||
/usr/local/bin/flask db init --directory /powerdns-admin/migrations
|
||||
/usr/local/bin/flask db migrate -m "Init DB" --directory /powerdns-admin/migrations
|
||||
/usr/local/bin/flask db upgrade --directory /powerdns-admin/migrations
|
||||
cd /powerdns-admin && ./init_data.py
|
||||
|
||||
else
|
||||
/usr/local/bin/flask db migrate -m "Upgrade BD Schema" --directory /powerdns-admin/migrations
|
||||
/usr/local/bin/flask db upgrade --directory /powerdns-admin/migrations
|
||||
fi
|
||||
|
||||
/usr/bin/supervisord -c /etc/supervisord.conf
|
||||
|
Reference in New Issue
Block a user