Public Repository

Last pushed: a year ago
Short Description
Short description is empty for this repo.
Full Description

Dockerfile:

FROM alpine:3.4
MAINTAINER zhenglixin@qiniu.com

ENV CARAVELE_VERSION=0.11.1 \
    PYTHONPATH=/caravel_config.py:$PYTHONPATH

RUN apk add --no-cache python3 mariadb-dev postgresql-dev cyrus-sasl-dev libffi-dev && \
    apk add --no-cache --virtual .build-deps python3-dev curl g++ nodejs git && \
    ln -s /usr/include/locale.h /usr/include/xlocale.h && \
    curl -L https://github.com/gofly/caravel/archive/${CARAVELE_VERSION}.tar.gz | tar zx && \
    cd caravel-${CARAVELE_VERSION}/caravel/assets && \
    npm install && \
    npm run prod && \
    cd ../.. && \
    cp docker/caravel_config.py / && \
    python3 setup.py install && \
    cd .. && \
    rm -rf caravel-${CARAVELE_VERSION} ~/.cache ~/.npm && \
    apk del --purge .build-deps


EXPOSE 8088

HEALTHCHECK CMD curl -f http://localhost:8088/health

CMD ["caravel", "runserver"]

docker-compose.yml

version: '2'
services:
  caravel:
    image: gofly/caravel:latest
    environment:
      SECRET_KEY: secret_key
      SQLALCHEMY_DATABASE_URI: mysql://user:secret@mysql/caravel
    user: root
    volumes:
      - /etc/localtime:/etc/localtime
    ports:
      - 8088:8088
    depends_on:
      - mysql
    links:
      - mysql

  mysql:
    image: mysql:latest
    volumes:
      - /etc/localtime:/etc/localtime
      - /etc/mysql/conf.d:/etc/mysql/conf.d
      - /var/lib/mysql:/var/lib/mysql
    expose:
      - 3306

init:


# Create an admin user
fabmanager create-admin --app caravel

# Initialize the database
caravel db upgrade

# Create default roles and permissions
caravel init
Docker Pull Command
Owner
gofly