Merge branch 'cicd/djangoldp_v2'
This commit is contained in:
commit
6502fb8b07
@ -42,7 +42,7 @@ test:e2e:
|
|||||||
stage: test
|
stage: test
|
||||||
image: cypress/included:5.6.0
|
image: cypress/included:5.6.0
|
||||||
services:
|
services:
|
||||||
- name: ${CI_REGISTRY_IMAGE}/server:0.1
|
- name: ${CI_REGISTRY_IMAGE}/djangoldp:2.0
|
||||||
before_script:
|
before_script:
|
||||||
# install missing dependencies
|
# install missing dependencies
|
||||||
- npm install -g sirv-cli
|
- npm install -g sirv-cli
|
||||||
|
5
internal/docker/README.md
Normal file
5
internal/docker/README.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# How to build a ldpserver image
|
||||||
|
|
||||||
|
Get the [Dockerfile](https://git.startinblox.com/djangoldp-packages/djangoldp/blob/master/Dockerfile) from the `djangoldp` project.
|
||||||
|
|
||||||
|
And build it with the `settings.yml` file: `docker build -t ldpserver .`
|
@ -1,26 +0,0 @@
|
|||||||
FROM python:3.6
|
|
||||||
LABEL maintainer="Plup <plup@plup.io>"
|
|
||||||
|
|
||||||
# get server address
|
|
||||||
ARG serve
|
|
||||||
|
|
||||||
# fix bug in manager install
|
|
||||||
ENV PATH="/root/.local/bin:${PATH}"
|
|
||||||
|
|
||||||
# install a LDP server with required functions
|
|
||||||
WORKDIR /app
|
|
||||||
RUN pip install git+https://git.startinblox.com/djangoldp-packages/server-manager.git
|
|
||||||
RUN sib startproject sibserver
|
|
||||||
COPY docker/packages.yml /app/sibserver/
|
|
||||||
RUN sed -i 's#SERVER#'"${serve:-http://localhost:8000}"'#' /app/sibserver/packages.yml
|
|
||||||
RUN cd /app/sibserver && sib install server
|
|
||||||
|
|
||||||
# fix invalid HTTP_HOST
|
|
||||||
RUN sed -i 's/ALLOWED_HOSTS\s=\s\[\]/ALLOWED_HOSTS=\["\*"\]/' /app/sibserver/server/settings.py
|
|
||||||
|
|
||||||
# run the dev server
|
|
||||||
EXPOSE 8000
|
|
||||||
ENTRYPOINT ["python", "/app/sibserver/manage.py"]
|
|
||||||
CMD ["runserver", "0.0.0.0:8000"]
|
|
||||||
|
|
||||||
# vim: ft=dockerfile:
|
|
@ -1,15 +0,0 @@
|
|||||||
---
|
|
||||||
version: '3'
|
|
||||||
|
|
||||||
services:
|
|
||||||
|
|
||||||
front:
|
|
||||||
environment:
|
|
||||||
- SERVER=http://127.0.0.1
|
|
||||||
ports:
|
|
||||||
- 80:80
|
|
||||||
|
|
||||||
server:
|
|
||||||
build:
|
|
||||||
args:
|
|
||||||
serve: http://127.0.0.1
|
|
@ -1,39 +0,0 @@
|
|||||||
---
|
|
||||||
version: '3'
|
|
||||||
|
|
||||||
services:
|
|
||||||
|
|
||||||
front:
|
|
||||||
build:
|
|
||||||
context: ../
|
|
||||||
dockerfile: docker/front.docker
|
|
||||||
environment:
|
|
||||||
- SERVER=http://server.org:8000
|
|
||||||
networks:
|
|
||||||
- web
|
|
||||||
|
|
||||||
server:
|
|
||||||
build:
|
|
||||||
context: ../
|
|
||||||
dockerfile: docker/djangoldp.docker
|
|
||||||
args:
|
|
||||||
serve: http://server.org:8000
|
|
||||||
networks:
|
|
||||||
web:
|
|
||||||
aliases:
|
|
||||||
- server.org
|
|
||||||
db:
|
|
||||||
|
|
||||||
e2e:
|
|
||||||
image: cypress/included:4.3.0
|
|
||||||
environment:
|
|
||||||
- CYPRESS_baseUrl=https://front
|
|
||||||
volumes:
|
|
||||||
- ../cypress:/cypress
|
|
||||||
- ../cypress.json:/cypress.json
|
|
||||||
networks:
|
|
||||||
- web
|
|
||||||
|
|
||||||
networks:
|
|
||||||
web:
|
|
||||||
db:
|
|
@ -1,37 +0,0 @@
|
|||||||
FROM node:12 AS builder
|
|
||||||
LABEL maintainer="Plup <plup@plup.io>"
|
|
||||||
|
|
||||||
# install dependencies
|
|
||||||
WORKDIR /build
|
|
||||||
ADD package.json package-lock.json ./
|
|
||||||
ADD src/ src/
|
|
||||||
RUN npm install --only=production
|
|
||||||
|
|
||||||
# build the app
|
|
||||||
ADD docker/config.json .
|
|
||||||
RUN npm run build
|
|
||||||
|
|
||||||
# change index to template
|
|
||||||
RUN mv /build/dist/index.html /build/dist/index.tpl
|
|
||||||
|
|
||||||
# generate a self signed certificate
|
|
||||||
RUN openssl req -x509 -newkey rsa:4096 -keyout /tmp/key.pem -out /tmp/cert.pem -days 365 -nodes -subj '/CN=localhost'
|
|
||||||
|
|
||||||
# serve
|
|
||||||
FROM nginx:latest
|
|
||||||
COPY --from=builder /build/dist /var/www
|
|
||||||
COPY --from=builder /tmp/*.pem /etc/nginx/
|
|
||||||
WORKDIR /var/www
|
|
||||||
|
|
||||||
# get specific config
|
|
||||||
COPY docker/nginx.conf /etc/nginx/conf.d/default.conf
|
|
||||||
EXPOSE 443
|
|
||||||
|
|
||||||
# get server address
|
|
||||||
ENV SERVER http://localhost:8000
|
|
||||||
|
|
||||||
# replace addresses at runtime
|
|
||||||
CMD /bin/bash -c "envsubst '\$SERVER' < index.tpl > index.html && \
|
|
||||||
exec nginx -g 'daemon off;'"
|
|
||||||
|
|
||||||
# vim: ft=dockerfile:
|
|
@ -1,9 +0,0 @@
|
|||||||
server {
|
|
||||||
listen 443 ssl default_server;
|
|
||||||
root /var/www/;
|
|
||||||
|
|
||||||
ssl_certificate /etc/nginx/cert.pem;
|
|
||||||
ssl_certificate_key /etc/nginx/key.pem;
|
|
||||||
|
|
||||||
try_files $uri $uri/ index.html =404;
|
|
||||||
}
|
|
@ -1,27 +0,0 @@
|
|||||||
ldppackages:
|
|
||||||
djangoldp_dashboard: djangoldp_dashboard
|
|
||||||
djangoldp_account: djangoldp_account
|
|
||||||
djangoldp_circle: djangoldp_circle
|
|
||||||
djangoldp_notification: djangoldp_notification
|
|
||||||
djangoldp_profile: djangoldp_profile
|
|
||||||
djangoldp_project: djangoldp_project
|
|
||||||
oidc_provider: 'git+https://github.com/jblemee/django-oidc-provider.git@develop'
|
|
||||||
|
|
||||||
server:
|
|
||||||
site_url: SERVER
|
|
||||||
allowed_hosts:
|
|
||||||
- '*'
|
|
||||||
db_host: database
|
|
||||||
db_name: postgres
|
|
||||||
db_user: postgres
|
|
||||||
db_pass: postgres
|
|
||||||
smtp_host:
|
|
||||||
smtp_user:
|
|
||||||
smtp_pass:
|
|
||||||
admin_email: test@startinblox.com
|
|
||||||
admin_name: admin
|
|
||||||
admin_pass: admin
|
|
||||||
xmpp_url: https://jabber.happy-dev.fr
|
|
||||||
jabber_host: 'none'
|
|
||||||
default_client: SERVER
|
|
||||||
registration_open: True
|
|
56
internal/docker/settings.yml
Normal file
56
internal/docker/settings.yml
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
---
|
||||||
|
dependencies:
|
||||||
|
- djangoldp-dashboard
|
||||||
|
- djangoldp-invoice
|
||||||
|
- djangoldp-contact
|
||||||
|
- djangoldp-account
|
||||||
|
- djangoldp-circle
|
||||||
|
- djangoldp-conversation
|
||||||
|
- djangoldp-joboffer
|
||||||
|
- djangoldp-notification
|
||||||
|
- djangoldp-profile
|
||||||
|
- djangoldp-project
|
||||||
|
- djangoldp-uploader
|
||||||
|
- djangoldp-skill
|
||||||
|
- djangoldp-i18n
|
||||||
|
- djangoldp-community
|
||||||
|
|
||||||
|
ldppackages:
|
||||||
|
- djangoldp_i18n
|
||||||
|
- djangoldp_dashboard
|
||||||
|
- djangoldp_account
|
||||||
|
- djangoldp_invoice
|
||||||
|
- djangoldp_contact
|
||||||
|
- djangoldp_community
|
||||||
|
- djangoldp_circle
|
||||||
|
- djangoldp_conversation
|
||||||
|
- djangoldp_joboffer
|
||||||
|
- djangoldp_notification
|
||||||
|
- djangoldp_profile
|
||||||
|
- djangoldp_project
|
||||||
|
- djangoldp_uploader
|
||||||
|
- djangoldp_skill
|
||||||
|
|
||||||
|
server:
|
||||||
|
DEBUG: true
|
||||||
|
ALLOWED_HOSTS:
|
||||||
|
- '*'
|
||||||
|
SECRET_KEY: 'theverylongsecretkey'
|
||||||
|
DATABASES:
|
||||||
|
default:
|
||||||
|
ENGINE: django.db.backends.sqlite3
|
||||||
|
NAME: db.sqlite3
|
||||||
|
LDP_RDF_CONTEXT: https://cdn.happy-dev.fr/owl/hdcontext.jsonld
|
||||||
|
ROOT_URLCONF: server.urls
|
||||||
|
STATIC_ROOT: static
|
||||||
|
MEDIA_ROOT: media
|
||||||
|
USE_I18N: true
|
||||||
|
BASE_URL: http://localhost:8000/
|
||||||
|
SITE_URL: http://localhost:8000/
|
||||||
|
JABBER_DEFAULT_HOST: http://localhost:8000/
|
||||||
|
INSTANCE_DEFAULT_CLIENT: http://localhost:8000/
|
||||||
|
REGISTRATION_OPEN: true
|
||||||
|
EMAIL_ON_ACCOUNT_CREATION: false
|
||||||
|
DEFAULT_REQUEST_TIMEOUT: 120
|
||||||
|
DEFAULT_BACKOFF_FACTOR: 2
|
||||||
|
MAX_ACTIVITY_RESCHEDULES: 4
|
Loading…
Reference in New Issue
Block a user