Compare commits
No commits in common. "develop" and "master-v12" have entirely different histories.
develop
...
master-v12
7 changed files with 23 additions and 240 deletions
|
@ -1 +0,0 @@
|
||||||
.drone.yml
|
|
100
.drone.yml
100
.drone.yml
|
@ -1,100 +0,0 @@
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
type: docker
|
|
||||||
name: default
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: debug
|
|
||||||
image: alpine
|
|
||||||
environment:
|
|
||||||
|
|
||||||
commands:
|
|
||||||
- 'echo "Repository: glenux/service-dolibarr"'
|
|
||||||
- 'echo "Git commit: ${DRONE_COMMIT_SHA:0:8}"'
|
|
||||||
|
|
||||||
- name: publish:commit_sha
|
|
||||||
image: plugins/docker
|
|
||||||
# pull: never
|
|
||||||
# volumes:
|
|
||||||
# - name: cache
|
|
||||||
# path: /stupid
|
|
||||||
environment:
|
|
||||||
DOCKER_REPO: glenux/service-dolibarr
|
|
||||||
settings:
|
|
||||||
username:
|
|
||||||
from_secret: DOCKERHUB_USERNAME
|
|
||||||
password:
|
|
||||||
from_secret: DOCKERHUB_PASSWORD
|
|
||||||
cache_from: "glenux/service-dolibarr:latest_${DRONE_BRANCH/\\//-}"
|
|
||||||
repo: glenux/service-dolibarr
|
|
||||||
tags: "${DRONE_COMMIT_SHA:0:8}"
|
|
||||||
purge: false
|
|
||||||
|
|
||||||
- name: publish:commit_branch
|
|
||||||
image: plugins/docker
|
|
||||||
# volumes:
|
|
||||||
# - name: cache
|
|
||||||
# path: /stupid
|
|
||||||
settings:
|
|
||||||
username:
|
|
||||||
from_secret: DOCKERHUB_USERNAME
|
|
||||||
password:
|
|
||||||
from_secret: DOCKERHUB_PASSWORD
|
|
||||||
cache_from: "glenux/service-dolibarr:${DRONE_BRANCH/\\//-}_latest"
|
|
||||||
repo: glenux/service-dolibarr
|
|
||||||
tags:
|
|
||||||
- "${DRONE_BRANCH/\\//-}_latest"
|
|
||||||
- "${DRONE_BRANCH/\\//-}_${DRONE_COMMIT_SHA:0:8}"
|
|
||||||
purge: false
|
|
||||||
when:
|
|
||||||
branch:
|
|
||||||
- "master"
|
|
||||||
- "develop"
|
|
||||||
- "feature/*"
|
|
||||||
|
|
||||||
- name: publish:latest
|
|
||||||
image: plugins/docker
|
|
||||||
settings:
|
|
||||||
username:
|
|
||||||
from_secret: DOCKERHUB_USERNAME
|
|
||||||
password:
|
|
||||||
from_secret: DOCKERHUB_PASSWORD
|
|
||||||
cache_from: "glenux/service-dolibarr:${DRONE_BRANCH/\\//-}_latest"
|
|
||||||
repo: glenux/service-dolibarr
|
|
||||||
tags: latest
|
|
||||||
purge: false
|
|
||||||
when:
|
|
||||||
branch:
|
|
||||||
- master
|
|
||||||
|
|
||||||
- name: deploy:dokku
|
|
||||||
image: alpine
|
|
||||||
when:
|
|
||||||
branch:
|
|
||||||
- master
|
|
||||||
environment:
|
|
||||||
SSH_USER:
|
|
||||||
from_secret: SSH_USER
|
|
||||||
SSH_HOST:
|
|
||||||
from_secret: SSH_HOST
|
|
||||||
SSH_PRIVATE_KEY:
|
|
||||||
from_secret: SSH_PRIVATE_KEY
|
|
||||||
commands:
|
|
||||||
- echo $SSH_USER
|
|
||||||
- echo $SSH_HOST
|
|
||||||
- echo $SSH_PRIVATE_KEY
|
|
||||||
- apk update && apk add openssh-client
|
|
||||||
- mkdir -p ~/.ssh && chmod 700 ~/.ssh
|
|
||||||
- echo "$SSH_PRIVATE_KEY" | base64 -d > ~/.ssh/deploy_key
|
|
||||||
- chmod 600 ~/.ssh/deploy_key
|
|
||||||
- |
|
|
||||||
ssh -o StrictHostKeyChecking=no \
|
|
||||||
-i ~/.ssh/deploy_key \
|
|
||||||
"$SSH_USER@$SSH_HOST" \
|
|
||||||
git:from-image erp \
|
|
||||||
"glenux/service-dolibarr:${DRONE_COMMIT_SHA:0:8}"
|
|
||||||
|
|
||||||
# volumes:
|
|
||||||
# - name: cache
|
|
||||||
# temp: {}
|
|
||||||
#
|
|
|
@ -1,86 +0,0 @@
|
||||||
---
|
|
||||||
# This file is a template, and might need editing before it works on your
|
|
||||||
# project. To contribute improvements to CI/CD templates, please follow the
|
|
||||||
# Development guide at:
|
|
||||||
# https://docs.gitlab.com/ee/development/cicd/templates.html
|
|
||||||
#
|
|
||||||
# This specific template is located at:
|
|
||||||
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Getting-Started.gitlab-ci.yml
|
|
||||||
|
|
||||||
# This is a sample GitLab CI/CD configuration file that should run without any
|
|
||||||
# modifications. It demonstrates a basic 3 stage CI/CD pipeline. Instead of
|
|
||||||
# real tests or scripts, it uses echo commands to simulate the pipeline
|
|
||||||
# execution.
|
|
||||||
#
|
|
||||||
# A pipeline is composed of independent jobs that run scripts, grouped into
|
|
||||||
# stages. Stages run in sequential order, but jobs within stages run in
|
|
||||||
# parallel.
|
|
||||||
#
|
|
||||||
# For more information, see:
|
|
||||||
# https://docs.gitlab.com/ee/ci/yaml/README.html#stages
|
|
||||||
|
|
||||||
# List of stages for jobs, and their order of execution
|
|
||||||
stages:
|
|
||||||
- build
|
|
||||||
- test
|
|
||||||
- deploy
|
|
||||||
|
|
||||||
build-docker-image: # This job runs in the build stage, which runs first.
|
|
||||||
stage: build
|
|
||||||
image: docker:latest
|
|
||||||
services:
|
|
||||||
- docker:dind
|
|
||||||
before_script:
|
|
||||||
- docker login
|
|
||||||
-u "$CI_REGISTRY_USER"
|
|
||||||
-p "$CI_REGISTRY_PASSWORD"
|
|
||||||
$CI_REGISTRY
|
|
||||||
- export VERSION="$(echo
|
|
||||||
"${CI_COMMIT_BRANCH}_$(date +%Y%m%dT%H%M%S)_${CI_COMMIT_SHA:0:8}"
|
|
||||||
|sed 's,/,--,g')"
|
|
||||||
# Default branch leaves tag empty (= latest tag)
|
|
||||||
# All other branches are tagged with the escaped branch name (commit ref slug)
|
|
||||||
script:
|
|
||||||
- |
|
|
||||||
if [ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]; then
|
|
||||||
tag=""
|
|
||||||
echo "Running on default branch '$CI_DEFAULT_BRANCH': tag = 'latest'"
|
|
||||||
else
|
|
||||||
tag=":$CI_COMMIT_REF_SLUG"
|
|
||||||
echo "Running on branch '$CI_COMMIT_BRANCH': tag = $tag"
|
|
||||||
fi
|
|
||||||
- docker build
|
|
||||||
--pull
|
|
||||||
--file Dockerfile
|
|
||||||
--tag "$CI_REGISTRY_IMAGE${tag}"
|
|
||||||
--tag "$CI_REGISTRY_IMAGE:$VERSION"
|
|
||||||
.
|
|
||||||
- docker push "$CI_REGISTRY_IMAGE${tag}"
|
|
||||||
- docker push "$CI_REGISTRY_IMAGE:$VERSION"
|
|
||||||
# Run this job in a branch where a Dockerfile exists
|
|
||||||
rules:
|
|
||||||
- if: $CI_COMMIT_BRANCH
|
|
||||||
exists:
|
|
||||||
- Dockerfile
|
|
||||||
|
|
||||||
# This job runs in the test stage.
|
|
||||||
# unit-test-job:
|
|
||||||
# # It only starts when the job in the build stage completes successfully.
|
|
||||||
# stage: test
|
|
||||||
# script:
|
|
||||||
# - echo "Running unit tests... This will take about 60 seconds."
|
|
||||||
# - sleep 60
|
|
||||||
# - echo "Code coverage is 90%"
|
|
||||||
|
|
||||||
# lint-test-job: # This job also runs in the test stage.
|
|
||||||
# stage: test # It can run at the same time as unit-test-job (in parallel).
|
|
||||||
# script:
|
|
||||||
# - echo "Linting code... This will take about 10 seconds."
|
|
||||||
# - sleep 10
|
|
||||||
# - echo "No lint issues found."
|
|
||||||
|
|
||||||
# deploy-job: # This job runs in the deploy stage.
|
|
||||||
# stage: deploy # It only runs when *both* jobs in the test stage complete successfully.
|
|
||||||
# script:
|
|
||||||
# - echo "Deploying application..."
|
|
||||||
# - echo "Application successfully deployed."
|
|
56
Dockerfile
56
Dockerfile
|
@ -1,67 +1,49 @@
|
||||||
FROM php:8.1-apache-bookworm
|
FROM php:7.2-apache-buster
|
||||||
# FROM php:7.4-apache-buster
|
|
||||||
MAINTAINER Glenn ROLLAND <glenux@glenux.net>
|
MAINTAINER Glenn ROLLAND <glenux@glenux.net>
|
||||||
|
|
||||||
|
ENV DOLIBARR_VERSION=12.0.1
|
||||||
|
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-cache search lib mysql dev$ \
|
&& apt-cache search lib mysql dev$ \
|
||||||
&& apt-get install -y \
|
&& apt-get install -y \
|
||||||
unzip curl \
|
wget unzip curl \
|
||||||
libfreetype6-dev \
|
libfreetype6-dev \
|
||||||
libicu-dev \
|
|
||||||
libjpeg62-turbo-dev \
|
libjpeg62-turbo-dev \
|
||||||
libmariadb-dev \
|
|
||||||
libpng-dev \
|
libpng-dev \
|
||||||
libzip-dev \
|
libmariadb-dev \
|
||||||
libc-client-dev \
|
|
||||||
libkrb5-dev \
|
|
||||||
zlib1g-dev \
|
zlib1g-dev \
|
||||||
|
libicu-dev \
|
||||||
&& apt-get autoremove -y \
|
&& apt-get autoremove -y \
|
||||||
&& docker-php-ext-install -j$(nproc) iconv \
|
&& docker-php-ext-install -j$(nproc) iconv \
|
||||||
&& docker-php-ext-configure intl \
|
&& docker-php-ext-configure intl \
|
||||||
&& docker-php-ext-install -j$(nproc) intl \
|
&& docker-php-ext-install -j$(nproc) intl \
|
||||||
&& docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ \
|
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
|
||||||
&& docker-php-ext-install -j$(nproc) gd \
|
&& docker-php-ext-install -j$(nproc) gd \
|
||||||
&& docker-php-ext-install pdo pdo_mysql mysqli \
|
&& docker-php-ext-install pdo pdo_mysql mysqli \
|
||||||
&& docker-php-ext-install calendar \
|
&& docker-php-ext-install calendar \
|
||||||
&& docker-php-ext-configure imap --with-kerberos --with-imap-ssl \
|
|
||||||
&& docker-php-ext-install imap \
|
|
||||||
&& docker-php-ext-install zip
|
&& docker-php-ext-install zip
|
||||||
|
|
||||||
COPY php-uploads.ini /usr/local/etc/php/conf.d/glenux-uploads.ini
|
|
||||||
COPY php-performance.ini /usr/local/etc/php/conf.d/glenux-performance.ini
|
|
||||||
COPY php-errors.ini /usr/local/etc/php/conf.d/glenux-errors.ini
|
|
||||||
|
|
||||||
RUN curl -sS https://getcomposer.org/installer \
|
RUN curl -sS https://getcomposer.org/installer \
|
||||||
| php -- --install-dir=/usr/local/bin --filename=composer
|
| php -- --install-dir=/usr/local/bin --filename=composer
|
||||||
|
|
||||||
ENV DOLIBARR_VERSION=19.0.2
|
RUN wget \
|
||||||
# ENV DOLIBARR_VERSION=18.0.4
|
-O /tmp/dolibarr-${DOLIBARR_VERSION}.zip \
|
||||||
# ENV DOLIBARR_VERSION=17.0.2
|
https://github.com/Dolibarr/dolibarr/archive/${DOLIBARR_VERSION}.zip
|
||||||
# ENV DOLIBARR_VERSION=16.0.4
|
|
||||||
# https://github.com/Dolibarr/dolibarr/archive/${DOLIBARR_VERSION}.zip
|
|
||||||
# https://freefr.dl.sourceforge.net/project/dolibarr/Dolibarr%20ERP-CRM/${DOLIBARR_VERSION}/dolibarr-${DOLIBARR_VERSION}.zip
|
|
||||||
RUN curl -sS \
|
|
||||||
https://freefr.dl.sourceforge.net/project/dolibarr/Dolibarr%20ERP-CRM/${DOLIBARR_VERSION}/dolibarr-${DOLIBARR_VERSION}.zip \
|
|
||||||
-o /tmp/dolibarr-${DOLIBARR_VERSION}.zip
|
|
||||||
|
|
||||||
RUN unzip -q -d /usr/src /tmp/dolibarr-${DOLIBARR_VERSION}.zip \
|
RUN unzip -d /usr/src /tmp/dolibarr-${DOLIBARR_VERSION}.zip \
|
||||||
&& chown -R www-data:www-data /usr/src/dolibarr-${DOLIBARR_VERSION} \
|
&& chown -R www-data:www-data /usr/src/dolibarr-${DOLIBARR_VERSION} \
|
||||||
&& rm -fr /var/www/html \
|
&& rm -fr /var/www/html \
|
||||||
&& cp -a /usr/src/dolibarr-${DOLIBARR_VERSION} /var/www/html
|
&& cp -a /usr/src/dolibarr-${DOLIBARR_VERSION} /var/www/html
|
||||||
|
|
||||||
|
ADD php-uploads.ini /usr/local/etc/php/conf.d/glenux-uploads.ini
|
||||||
|
ADD php-performance.ini /usr/local/etc/php/conf.d/glenux-performance.ini
|
||||||
|
ADD php-errors.ini /usr/local/etc/php/conf.d/glenux-errors.ini
|
||||||
|
|
||||||
|
RUN sed \
|
||||||
|
-i 's|/var/www/html|/var/www/html/htdocs|' \
|
||||||
|
/etc/apache2/sites-enabled/000-default.conf
|
||||||
|
|
||||||
WORKDIR /var/www/html
|
WORKDIR /var/www/html
|
||||||
|
|
||||||
# RUN pwd \
|
CMD composer install && apache2-foreground
|
||||||
# && ls -lh \
|
|
||||||
# && mv composer.json.disabled composer.json \
|
|
||||||
# && composer install
|
|
||||||
|
|
||||||
# Fix configuration
|
|
||||||
RUN sed -i 's|/var/www/html|/var/www/html/htdocs|' \
|
|
||||||
/etc/apache2/sites-enabled/000-default.conf \
|
|
||||||
&& sed -i 's|^Timeout .*|Timeout 1200|' \
|
|
||||||
/etc/apache2/apache2.conf
|
|
||||||
|
|
||||||
CMD ["apache2-foreground"]
|
|
||||||
|
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
|
|
||||||
|
|
||||||
Ref: https://wiki.dolibarr.org/index.php?title=Setup_Other
|
|
||||||
|
|
||||||
PROJECT_ALLOW_COMMENT_ON_TASK
|
|
||||||
PROJECT_ALLOW_COMMENT_ON_PROJECT
|
|
||||||
|
|
|
@ -1,11 +1,6 @@
|
||||||
error_reporting = E_ALL & ~E_WARNING & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED
|
error_reporting = E_ALL & ~E_WARNING & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED
|
||||||
|
display_errors = Off
|
||||||
|
|
||||||
log_errors = On
|
log_errors = On
|
||||||
|
error_log = /dev/stderr
|
||||||
## For production
|
|
||||||
# display_errors = Off
|
|
||||||
# error_log = /dev/stderr
|
|
||||||
|
|
||||||
## For debugging
|
|
||||||
display_errors = On
|
|
||||||
error_log = /var/log/php-errors.log
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
file_uploads = On
|
file_uploads = On
|
||||||
upload_max_filesize = 128M
|
upload_max_filesize = 128M
|
||||||
post_max_size = 128M
|
post_max_size = 128M
|
||||||
max_execution_time = 1200
|
max_execution_time = 600
|
||||||
max_input_time = 120
|
max_input_time = 120
|
||||||
|
|
Loading…
Reference in a new issue