Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial WireCloud 1.4 docker image #65

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
wirecloud-version:
- "1.2"
- "1.3"
- "1.4"
- "dev"
- "latest"

Expand All @@ -41,7 +42,7 @@ jobs:
VERSION: ${{ matrix.wirecloud-version }}
run: |
docker build --squash -t fiware/wirecloud:${VERSION} .
test "${VERSION}" = "latest" && sed -ri "s|fiware/wirecloud:1.3|fiware/wirecloud:latest|g" docker-compose*.yml || true
test "${VERSION}" = "latest" && sed -ri "s|fiware/wirecloud:1.4|fiware/wirecloud:latest|g" docker-compose*.yml || true
sudo python3 tests.py
- name: Push to docker
env:
Expand Down
4 changes: 4 additions & 0 deletions 1.4/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/elasticsearch-data/
/postgres-data/
/wirecloud-data/
/wirecloud-static/
41 changes: 41 additions & 0 deletions 1.4/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
ARG PYTHON_VERSION=3.8
FROM python:${PYTHON_VERSION}-slim

ENV GITHUB_ACCOUNT=${GITHUB_ACCOUNT} \
GITHUB_REPOSITORY=${GITHUB_REPOSITORY} \
DEFAULT_THEME=wirecloud.defaulttheme \
FORWARDED_ALLOW_IPS=* \
DB_PORT=5432 \
LOGLEVEL=info

# Install WireCloud & dependencies
COPY ./docker-entrypoint.sh /
COPY ./manage.py /usr/local/bin/

RUN apt update && \
apt install -y --no-install-recommends libmemcached-dev libpcre3-dev gosu gcc ca-certificates curl && \
pip install --no-cache-dir social-auth-app-django "gunicorn==19.3.0" "psycopg2-binary<2.9" pylibmc pysolr "elasticsearch==2.4.1" && \
pip install --no-cache-dir "wirecloud<1.5" && \
adduser --system --group --shell /bin/bash wirecloud && \
pip install --no-cache-dir "channels<2.3" "channels-redis" "channels-rabbitmq" "wirecloud-keycloak>=0.3.0" && \
mkdir -p /opt/wirecloud_instance /var/www/static && \
cd /opt && \
wirecloud-admin startproject wirecloud_instance wirecloud_instance && \
chown -R wirecloud:wirecloud wirecloud_instance /var/www/static && \
chmod a+x wirecloud_instance/manage.py && \
chmod a+x /docker-entrypoint.sh && \
apt-get remove -y gcc libmemcached-dev --autoremove && \
rm -rf /var/lib/apt/lists/*

COPY ./settings.py ./urls.py /opt/wirecloud_instance/wirecloud_instance/

WORKDIR /opt/wirecloud_instance

VOLUME /var/www/static
VOLUME /opt/wirecloud_instance/data

HEALTHCHECK --interval=5s \
--start-period=120s \
CMD curl --fail http://localhost:8000/api/features || exit 1

ENTRYPOINT ["/docker-entrypoint.sh"]
68 changes: 68 additions & 0 deletions 1.4/docker-compose-config-file.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
version: "3"

services:

nginx:
restart: always
image: nginx:latest
ports:
- 80:80
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- wirecloud-static:/var/www/static:ro
depends_on:
- wirecloud


postgres:
restart: always
image: postgres:latest
environment:
- POSTGRES_PASSWORD=wirepass # Change this password!
volumes:
- postgres-data:/var/lib/postgresql/data


elasticsearch:
restart: always
image: elasticsearch:2.4
volumes:
- elasticsearch-data:/usr/share/elasticsearch/data
command: elasticsearch -Des.index.max_result_window=50000


memcached:
restart: always
image: memcached:1
command: memcached -m 2048m


wirecloud:
restart: always
image: fiware/wirecloud:dev
depends_on:
- postgres
- elasticsearch
- memcached
environment:
- DEBUG=False
# - DEFAULT_THEME=wirecloud.defaulttheme
- DB_HOST=postgres
- DB_PASSWORD=wirepass # Change this password!
- FORWARDED_ALLOW_IPS=*
- ELASTICSEARCH2_URL=http://elasticsearch:9200/
- MEMCACHED_LOCATION=memcached:11211
# Uncomment the following environment variables to enable IDM integration
#- FIWARE_IDM_SERVER=${FIWARE_IDM_SERVER}
#- SOCIAL_AUTH_FIWARE_KEY=${SOCIAL_AUTH_FIWARE_KEY}
#- SOCIAL_AUTH_FIWARE_SECRET=${SOCIAL_AUTH_FIWARE_SECRET}
volumes:
- wirecloud-data:/opt/wirecloud_instance/data
- wirecloud-static:/var/www/static
- ./settings.py:/opt/wirecloud_instance/wirecloud_instance/settings.py:ro

volumes:
elasticsearch-data:
postgres-data:
wirecloud-data:
wirecloud-static:
17 changes: 17 additions & 0 deletions 1.4/docker-compose-custom-user.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: "3"

services:

wirecloud:
restart: always
image: fiware/wirecloud:dev
# If you want to use a user from the host, provide here the id of the
# user, e.g. `export WIRECLOUD_USER=$(id -u username)`
user: ${WIRECLOUD_USER:-0}
ports:
- 80:8000
environment:
- DEBUG=True
volumes:
- ./wirecloud-data:/opt/wirecloud_instance/data
- ./wirecloud-static:/var/www/static
83 changes: 83 additions & 0 deletions 1.4/docker-compose-idm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
version: "3"

services:

nginx:
restart: always
image: nginx:latest
ports:
- 80:80
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- wirecloud-static:/var/www/static:ro
depends_on:
- wirecloud


postgres:
restart: always
image: postgres:latest
environment:
- POSTGRES_PASSWORD=wirepass # Change this password!
volumes:
- postgres-data:/var/lib/postgresql/data


elasticsearch:
restart: always
image: elasticsearch:2.4
volumes:
- elasticsearch-data:/usr/share/elasticsearch/data
command: elasticsearch -Des.index.max_result_window=50000


memcached:
restart: always
image: memcached:1
command: memcached -m 2048m


mysql:
restart: always
image: mysql/mysql-server:5.7.21
environment:
- MYSQL_ROOT_PASSWORD=idm
- MYSQL_ROOT_HOST=%


keyrock:
restart: always
image: fiware/idm:7.0.2
ports:
- 3000:3000
environment:
- DATABASE_HOST=mysql


wirecloud:
restart: always
image: fiware/wirecloud:dev
depends_on:
- postgres
- elasticsearch
- memcached
environment:
- DEBUG=False
# - DEFAULT_THEME=wirecloud.defaulttheme
- DB_HOST=postgres
- DB_PASSWORD=wirepass # Change this password!
- FORWARDED_ALLOW_IPS=*
- ELASTICSEARCH2_URL=http://elasticsearch:9200/
- MEMCACHED_LOCATION=memcached:11211
- FIWARE_IDM_SERVER=${FIWARE_IDM_SERVER}
- SOCIAL_AUTH_FIWARE_KEY=${SOCIAL_AUTH_FIWARE_KEY}
- SOCIAL_AUTH_FIWARE_SECRET=${SOCIAL_AUTH_FIWARE_SECRET}
volumes:
- wirecloud-data:/opt/wirecloud_instance/data
- wirecloud-static:/var/www/static

volumes:
elasticsearch-data:
postgres-data:
wirecloud-data:
wirecloud-static:
29 changes: 29 additions & 0 deletions 1.4/docker-compose-simple.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
version: "3"

services:

nginx:
restart: always
image: nginx:latest
ports:
- 80:80
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- wirecloud-static:/var/www/static:ro
depends_on:
- wirecloud


wirecloud:
restart: always
image: fiware/wirecloud:dev
environment:
- DEBUG=False
- FORWARDED_ALLOW_IPS=*
volumes:
- wirecloud-data:/opt/wirecloud_instance/data
- wirecloud-static:/var/www/static

volumes:
wirecloud-data:
wirecloud-static:
18 changes: 18 additions & 0 deletions 1.4/docker-compose-standalone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: "3"

services:

wirecloud:
restart: always
image: fiware/wirecloud:dev
ports:
- 80:8000
environment:
- DEBUG=True
volumes:
- wirecloud-data:/opt/wirecloud_instance/data
- wirecloud-static:/var/www/static

volumes:
wirecloud-data:
wirecloud-static:
75 changes: 75 additions & 0 deletions 1.4/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
version: "3"

services:

nginx:
restart: always
image: nginx:latest
ports:
- 80:80
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- wirecloud-static:/var/www/static:ro
depends_on:
- wirecloud


postgres:
restart: always
image: postgres:latest
environment:
- POSTGRES_PASSWORD=wirepass # Change this password!
volumes:
- postgres-data:/var/lib/postgresql/data


elasticsearch:
restart: always
image: elasticsearch:2.4
volumes:
- elasticsearch-data:/usr/share/elasticsearch/data
command: elasticsearch -Des.index.max_result_window=50000


memcached:
restart: always
image: memcached:1
command: memcached -m 2048m


wirecloud:
restart: always
image: fiware/wirecloud:dev
depends_on:
- postgres
- elasticsearch
- memcached
environment:
- DEBUG=False
- LOGLEVEL=INFO
# - DEFAULT_THEME=wirecloud.defaulttheme
- DB_HOST=postgres
- DB_PASSWORD=wirepass # Change this password!
- FORWARDED_ALLOW_IPS=*
- ELASTICSEARCH2_URL=http://elasticsearch:9200/
- MEMCACHED_LOCATION=memcached:11211
# Uncomment the following environment variables to enable FIWARE IDM integration
#- FIWARE_IDM_SERVER=${FIWARE_IDM_SERVER}
#- SOCIAL_AUTH_FIWARE_KEY=${SOCIAL_AUTH_FIWARE_KEY}
#- SOCIAL_AUTH_FIWARE_SECRET=${SOCIAL_AUTH_FIWARE_SECRET}
# Uncomment the following environment variables to enable Keycloak IDM Integration
#- KEYCLOAK_IDM_SERVER=${KEYCLOAK_IDM_SERVER}
#- KEYCLOAK_REALM=${KEYCLOAK_REALM}
#- KEYCLOAK_KEY=${KEYCLOAK_KEY}
#- KEYCLOAK_GLOBAL_ROLE=${KEYCLOAK_GLOBAL_ROLE}
#- SOCIAL_AUTH_KEYCLOAK_KEY=${SOCIAL_AUTH_KEYCLOAK_KEY}
#- SOCIAL_AUTH_KEYCLOAK_SECRET=${SOCIAL_AUTH_KEYCLOAK_SECRET}
volumes:
- wirecloud-data:/opt/wirecloud_instance/data
- wirecloud-static:/var/www/static

volumes:
elasticsearch-data:
postgres-data:
wirecloud-data:
wirecloud-static:
Loading