Skip to content

Commit

Permalink
add docker compose file for ci
Browse files Browse the repository at this point in the history
Signed-off-by: Swikriti Tripathi <[email protected]>
  • Loading branch information
SwikritiT committed Aug 30, 2023
1 parent e97ebd2 commit 7f888b6
Show file tree
Hide file tree
Showing 3 changed files with 119 additions and 12 deletions.
17 changes: 8 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ jobs:
run: |
composer install --no-progress --prefer-dist --optimize-autoloader
git clone --depth 1 https://github.com/nextcloud/server.git -b ${{ matrix.nextcloudVersion }}
ls -al
# cd server && git submodule update --init
# ./occ maintenance:install --admin-pass=admin

Expand Down Expand Up @@ -98,14 +97,14 @@ jobs:
mkdir -p server/apps/integration_openproject
cp -r `ls -A | grep -v 'server'` server/apps/integration_openproject/
cd server
pwd
# apt update -y
# apt install openssl -y
# apt install curl -y
# openssl version
# openssl req -subj '/CN=nextcloud.local/C=NP/L=Pokhara' -x509 -sha256 -nodes -days 3650 -newkey rsa:2048 -keyout ./data/ssl/nextcloud.local.key -out ./data/ssl/nextcloud.local.crt
# ls ./data/ssl
#
apt update -y
apt install openssl -y
apt install curl -y
openssl version
openssl req -subj '/CN=nextcloud.local/C=NP/L=Pokhara' -x509 -sha256 -nodes -days 3650 -newkey rsa:2048 -keyout ./apps/integration_openproject/ci/data/ssl/nextcloud.local.key -out ./apps/integration_openproject/ci/data/ssl/nextcloud.local.crt
update-ca-certificates
ls ./apps/integration_openproject/ci/data/ssl
docker compose version
# - name: JS Code Coverage Summary Report
# if: ${{ github.event_name == 'pull_request' && matrix.nextcloudVersion == 'master' && matrix.phpVersion == '8.1' }}
# uses: romeovs/[email protected]
Expand Down
Empty file added ci/data/ssl/.gitkeep
Empty file.
114 changes: 111 additions & 3 deletions ci/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,112 @@
FROM ubuntu:latest
LABEL authors="swikriti"
version: '3'

ENTRYPOINT ["top", "-b"]
services:

# Proxy for ssl termination and easier hostname access
# SSL certificates with the virtual host name need to be added to ./data/ssl
proxy:
image: ghcr.io/juliushaertl/nextcloud-dev-nginx:latest
ports:
- "${PROXY_PORT_HTTP:-80}:80"
- "${PROXY_PORT_HTTPS:-443}:443"
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- ./data/ssl/:/etc/nginx/certs
environment:
DHPARAM_BITS: 2048
DHPARAM_GENERATION: "false"
HTTPS_METHOD: "noredirect"
HSTS: "off"
cap_add:
- SYS_ADMIN
networks:
default:
aliases:
- nextcloud${DOMAIN_SUFFIX}

nextcloud:
image: ghcr.io/juliushaertl/nextcloud-dev-php${PHP_VERSION:-81}:latest
environment:
SQL: ${SQL:-mysql}
NEXTCLOUD_AUTOINSTALL: "YES"
NEXTCLOUD_AUTOINSTALL_APPS:
WITH_REDIS: "YES"
VIRTUAL_HOST: "nextcloud${DOMAIN_SUFFIX}"
ADDITIONAL_APPS_PATH:
NEXTCLOUD_TRUSTED_DOMAINS:
PRIMARY: ${PRIMARY}
PHP_XDEBUG_MODE: ${PHP_XDEBUG_MODE:-develop}
volumes:
- '${STABLE_ROOT_PATH}:/var/www/html'
- '${STABLE_ROOT_PATH}/apps-extra:/var/www/html/apps-extra'
- /var/www/html/data
- /var/www/html/config
- /var/www/html/apps-writable
depends_on:
- ${DB_SERVICE:-database-mysql}
- redis
- proxy
extra_hosts:
- host.docker.internal:host-gateway

database-mysql:
image: mariadb:10.6
environment:
MYSQL_ROOT_PASSWORD: 'nextcloud'
MYSQL_PASSWORD: 'nextcloud'
MYSQL_USER: 'nextcloud'
MYSQL_DATABASE: 'nextcloud'
ports:
- "${PORTBASE:-800}2:3306"
volumes:
- mysql:/var/lib/mysql

database-postgres:
image: postgres:latest
environment:
POSTGRES_DB: nextcloud
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
expose:
- 5432
volumes:
- postgres:/var/lib/postgresql

redis:
image: redis:7

openproject:
image: openproject/community:13
environment:
OPENPROJECT_SECRET_KEY_BASE: "secret"
OPENPROJECT_HOST__NAME: "host.docker.internal:3000"
OPENPROJECT_DEV_EXTRA_HOSTS: "host.docker.internal"
OPENPROJECT_HTTPS: false
HOST: 0.0.0.0
OPENPROJECT_PASSWORD__MIN__LENGTH: 0
OPENPROJECT_ONBOARDING__ENABLED: false
OPENPROJECT_AUTHENTICATION_GLOBAL__BASIC__AUTH_USER: "apiadmin"
OPENPROJECT_AUTHENTICATION_GLOBAL__BASIC__AUTH_PASSWORD: "apiadmin"
CI: true
ports:
- "3000:80"
extra_hosts:
- host.docker.internal:host-gateway
volumes:
- ./data/ssl/:/usr/local/share/ca-certificates
# command: ["sh", "-c", "sudo update-ca-certificates && exec ./docker/prod/supervisord"]


volumes:
data:
config:
mysql:
postgres:

networks:
default:
ipam:
driver: default
config:
- subnet: ${DOCKER_SUBNET:-192.168.21.0/24}

0 comments on commit 7f888b6

Please sign in to comment.