forked from cesium-ml/cesium_web
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
95 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
FROM ubuntu:16.04 | ||
|
||
RUN apt-get update && \ | ||
apt-get -y upgrade && \ | ||
apt-get install -y python3 python3-venv libpq-dev libhdf5-serial-dev \ | ||
libnetcdf-dev supervisor libpython3-dev supervisor \ | ||
nginx npm nodejs | ||
|
||
RUN python3 -m venv /cesium_env | ||
|
||
ADD . /cesium | ||
WORKDIR /cesium | ||
RUN bash -c "source /cesium_env/bin/activate && \ | ||
pip install --upgrade pip && \ | ||
pip install --upgrade pip && \ | ||
export PIP_FIND_LINKS=http://wheels.scikit-image.org && \ | ||
make paths && \ | ||
make dependencies && \ | ||
cp docker/cesium_docker.yaml . && \ | ||
cp docker/* . && \ | ||
ln -s /usr/bin/nodejs /usr/bin/node" | ||
|
||
EXPOSE 5000 | ||
|
||
CMD bash -c "source /cesium_env/bin/activate && \ | ||
supervisord -c conf/supervisord.conf" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
|
||
version: '2' | ||
|
||
services: | ||
web: | ||
image: cesium/web | ||
ports: | ||
- "80:5000" | ||
links: | ||
- db | ||
- celery | ||
volumes: | ||
- .:/home/cesium_app | ||
depends_on: | ||
- db | ||
- rabbit | ||
- celery | ||
|
||
db: | ||
image: cesium/postgres | ||
volumes: | ||
- ./_postgres_data:/var/lib/postgresql/data/ | ||
environment: | ||
- POSTGRES_USER=cesium | ||
- POSTGRES_PASSWORD= | ||
- POSTGRES_DB=cesium | ||
- PGDATA=/var/lib/postgresql/data/pgdata | ||
|
||
rabbit: | ||
image: rabbitmq:3 | ||
ports: | ||
- "5672:5672" | ||
|
||
celery: | ||
image: celery | ||
depends_on: | ||
- rabbit | ||
links: | ||
- rabbit | ||
environment: | ||
- CELERY_BROKER=amqp://guest:guest@rabbit:5672/ | ||
- CELERY_BROKER_URL=amqp://guest:guest@rabbit:5672/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
database: | ||
database: cesium | ||
host: db | ||
port: 5432 | ||
user: cesium | ||
password: | ||
|
||
server: | ||
url: http://localhost:5000 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
FROM postgres:9.5 | ||
ADD ./init-user-db.sh /docker-entrypoint-initdb.d/init-user-db.sh | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" <<-EOSQL | ||
CREATE USER cesium; | ||
CREATE DATABASE cesium; | ||
GRANT ALL PRIVILEGES ON DATABASE cesium TO cesium; | ||
EOSQL | ||
|
||
cd /cesium | ||
source /cesium_env/bin/activate && \ | ||
PYTHONPATH=. python -c "from cesium_app.models import create_tables as c; c()" | ||
|