diff --git a/.env.example b/.env.example index 186ba4a..54c192d 100644 --- a/.env.example +++ b/.env.example @@ -1,6 +1,6 @@ DEBUG=True REAL_DATABASE_URL="..." # for `fab pull_db` to work -DATABASE_URL="postgres://postgres@localhost/star" +DATABASE_URL="postgres://postgres:postgres@db/star" SECRET_KEY=nsPna8hFnaNIn32aasd0a21ldM PYTHONUNBUFFERED=True TANGO_API_URL="https://sandbox.tangocard.com/raas/v1/" @@ -11,3 +11,4 @@ AWS_BUCKET_TEMPLATE="%s.yourname.stargeo.io" BIOPORTAL_API_KEY="o239hfnsf-2311-mmas-19204oifna0" FROM_EMAIL="no-reply@stargeo.org" ADMIN="Admin Name:admin.email@gmail.com" +BROKER_URL="redis://redis:6379/0" \ No newline at end of file diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 7f2cdd4..e642341 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -7,6 +7,8 @@ jobs: release: name: Build and release image to Docker Hub runs-on: ubuntu-latest + env: + BUILD_IMAGE: bedasoftware/stargeo:latest steps: - uses: actions/checkout@v3 - name: Set up Docker Buildx @@ -16,11 +18,7 @@ jobs: with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build and push - uses: docker/build-push-action@v4 - with: - context: . - file: Dockerfile.prod - push: true - tags: bedasoftware/stargeo:latest - platforms: linux/amd64,linux/arm64 \ No newline at end of file + - run: >- + docker buildx build --platform linux/arm64,linux/amd64 + -f Dockerfile.prod + --push -t ${{ env.BUILD_IMAGE }} . \ No newline at end of file diff --git a/.gitignore b/.gitignore index 5640ac8..ff1f929 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,5 @@ frontend/npm-debug.log .ropeproject *bundle.js public + +.python-version \ No newline at end of file diff --git a/Dockerfile.prod b/Dockerfile.prod index 75932e2..2c031f5 100644 --- a/Dockerfile.prod +++ b/Dockerfile.prod @@ -1,4 +1,4 @@ -FROM python:2.7-slim +FROM python:3.6.9-slim # Install R and its meta package RUN apt-get update && apt-get install -y --no-install-recommends \ r-base-core r-base-dev \ @@ -11,7 +11,7 @@ RUN mkdir -p /app/user /app/logs WORKDIR /app/user RUN pip install --upgrade pip ADD requirements.txt /app/user/requirements.txt -RUN pip install --no-cache-dir -r requirements.txt +RUN pip install --exists-action=s -r requirements.txt # Add code ADD . /app/user EXPOSE 8000 diff --git a/compose.prod.yaml b/compose.prod.yaml index f317f42..e3310b6 100644 --- a/compose.prod.yaml +++ b/compose.prod.yaml @@ -1,3 +1,4 @@ +name: stargeo-prod services: db: image: postgres:9.4 @@ -6,9 +7,9 @@ services: - POSTGRES_PASSWORD healthcheck: test: [ "CMD", "pg_isready", "-U", "${PGUSER:-postgres}" ] - interval: 5s - timeout: 5s - retries: 5 + interval: 1s + timeout: 10s + retries: 50 redis: image: redis:3 @@ -29,7 +30,7 @@ services: redis: condition: service_healthy ports: - - "8000:8000" + - "8001:8000" env_file: .env.prod celery: diff --git a/requirements-dev.txt b/requirements-dev.txt index 9b9a5f8..20c15da 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -5,7 +5,7 @@ flake8>=3.5.0 flake8-print flake8-per-file-ignores pep8-naming -pytest==2.6.4 +pytest~=2.9 pytest-django==3.1.2 lxml cssselect diff --git a/requirements.freezed.txt b/requirements.freezed.txt new file mode 100644 index 0000000..13323e2 --- /dev/null +++ b/requirements.freezed.txt @@ -0,0 +1,64 @@ +amqp==1.4.9 +anyjson==0.3.3 +asn1crypto==0.24.0 +bcrypt==3.1.4 +billiard==3.3.0.23 +biopython==1.68 +boto==2.38.0 +celery==3.1.17 +certifi==2018.10.15 +cffi==1.11.5 +chardet==3.0.4 +coreapi==2.3.3 +coreschema==0.0.4 +cryptography==2.3.1 +dj-database-url==0.4.2 +Django==1.11.10 +django-cacheops==4.0.5 +django-datatable-view-compat==0.8.2 +django-filter==1.1.0 +django-jinja==2.4.1 +django-jinja-bootstrap-form==4.0.3 +django-pandas==0.4.5 +django-registration==2.0.4 +django-rest-swagger==2.1.1 +djangorestframework==3.5.3 +easydict==1.7 +Fabric3==1.13.1.post1 +ftptool==0.7.1 +funcy==1.11 +gunicorn==19.7.1 +handy==0.7 +honcho==0.6.4 +idna==2.6 +itypes==1.1.0 +Jinja2==2.10 +kombu==3.0.37 +MarkupSafe==1.0 +mygene==3.0.0 +numexpr==2.6.2 +numpy==1.14.1 +oauthlib==2.1.0 +openapi-codec==1.3.2 +pandas==0.22.0 +paramiko==2.4.2 +patsy==0.5.0 +pkg-resources==0.0.0 +psycopg2==2.7.3.2 +pyasn1==0.4.4 +pycparser==2.19 +PyNaCl==1.3.0 +python-dateutil==2.7.3 +pytz==2018.5 +redis==2.10.6 +requests==2.18.4 +requests-oauthlib==0.8.0 +rpy2==2.9.2 +scipy==1.0.0 +simplejson==3.16.0 +six==1.11.0 +statsmodels==0.8.0 +termcolor==1.1.0 +tqdm==4.19.5 +uritemplate==3.0.0 +urllib3==1.22 diff --git a/requirements.txt b/requirements.txt index 489eabc..4a07a20 100644 --- a/requirements.txt +++ b/requirements.txt @@ -20,7 +20,7 @@ tqdm==4.19.5 requests==2.18.4 ftptool==0.7.1 django-cacheops==4.0.5 -pandas==0.22 +pandas==0.22.0 termcolor==1.1.0 numpy==1.16.1 numexpr==2.6.2 # There is an issue with newer version @@ -34,6 +34,6 @@ django-datatable-view-compat==0.8.2 boto==2.38.0 rpy2==2.8.6 django-registration==2.0.4 -biopython==1.68 +biopython==1.76 mygene==3.0.0 requests-oauthlib==0.8.0