Compare commits
58 commits
master-v12
...
develop
Author | SHA1 | Date | |
---|---|---|---|
769f1da8a5 | |||
4fbf104d74 | |||
e7108f75ff | |||
85de3324a5 | |||
6f7c494d14 | |||
77b5f112d4 | |||
b5c4f8fbc0 | |||
72d5bd938c | |||
70763feb6d | |||
a9d934f08a | |||
5f1de8cc30 | |||
fe18d27f18 | |||
d1e81d12be | |||
83bb0658c5 | |||
0ad4ab4472 | |||
4719fe9e62 | |||
0632220a79 | |||
71e2ce8db5 | |||
984598ec33 | |||
45e0948b92 | |||
eb6f15efaf | |||
9998bfe548 | |||
eec4543953 | |||
f95b7ff10e | |||
ddcac30b89 | |||
f10eb465b2 | |||
19062e486c | |||
dcaa4e1a9c | |||
97b8c096fc | |||
c2aa144483 | |||
ccbed63d42 | |||
e47e667fc6 | |||
ce0a5ba5e8 | |||
56ff8e2a0c | |||
e47f9c1e82 | |||
b35ce6e142 | |||
fdd09cc808 | |||
44a540febf | |||
de01e459f1 | |||
667c98ea3c | |||
4f51237e2a | |||
97a08ec973 | |||
a12dfd4f52 | |||
382603d2e3 | |||
b466e8e4b4 | |||
6a43b24044 | |||
2d65ae1fb7 | |||
7147f1019d | |||
b123b2eec7 | |||
64060b1588 | |||
180e0e8cd7 | |||
be3de753c3 | |||
04430d40ab | |||
e21f508b8a | |||
0f64c6f6d9 | |||
90f573d53f | |||
5c14290480 | |||
9bb279f7dc |
7 changed files with 242 additions and 25 deletions
1
.dockerignore
Normal file
1
.dockerignore
Normal file
|
@ -0,0 +1 @@
|
|||
.drone.yml
|
100
.drone.yml
Normal file
100
.drone.yml
Normal file
|
@ -0,0 +1,100 @@
|
|||
---
|
||||
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: {}
|
||||
#
|
86
.gitlab-ci.yml
Normal file
86
.gitlab-ci.yml
Normal file
|
@ -0,0 +1,86 @@
|
|||
---
|
||||
# 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."
|
60
Dockerfile
60
Dockerfile
|
@ -1,49 +1,67 @@
|
|||
FROM php:7.2-apache-buster
|
||||
FROM php:8.1-apache-bookworm
|
||||
# FROM php:7.4-apache-buster
|
||||
MAINTAINER Glenn ROLLAND <glenux@glenux.net>
|
||||
|
||||
ENV DOLIBARR_VERSION=12.0.1
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-cache search lib mysql dev$ \
|
||||
&& apt-get install -y \
|
||||
wget unzip curl \
|
||||
unzip curl \
|
||||
libfreetype6-dev \
|
||||
libjpeg62-turbo-dev \
|
||||
libpng-dev \
|
||||
libmariadb-dev \
|
||||
zlib1g-dev \
|
||||
libicu-dev \
|
||||
libjpeg62-turbo-dev \
|
||||
libmariadb-dev \
|
||||
libpng-dev \
|
||||
libzip-dev \
|
||||
libc-client-dev \
|
||||
libkrb5-dev \
|
||||
zlib1g-dev \
|
||||
&& apt-get autoremove -y \
|
||||
&& docker-php-ext-install -j$(nproc) iconv \
|
||||
&& docker-php-ext-configure intl \
|
||||
&& docker-php-ext-install -j$(nproc) intl \
|
||||
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
|
||||
&& docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ \
|
||||
&& docker-php-ext-install -j$(nproc) gd \
|
||||
&& docker-php-ext-install pdo pdo_mysql mysqli \
|
||||
&& 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
|
||||
|
||||
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 \
|
||||
| php -- --install-dir=/usr/local/bin --filename=composer
|
||||
|
||||
RUN wget \
|
||||
-O /tmp/dolibarr-${DOLIBARR_VERSION}.zip \
|
||||
https://github.com/Dolibarr/dolibarr/archive/${DOLIBARR_VERSION}.zip
|
||||
ENV DOLIBARR_VERSION=19.0.2
|
||||
# ENV DOLIBARR_VERSION=18.0.4
|
||||
# ENV DOLIBARR_VERSION=17.0.2
|
||||
# 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 -d /usr/src /tmp/dolibarr-${DOLIBARR_VERSION}.zip \
|
||||
RUN unzip -q -d /usr/src /tmp/dolibarr-${DOLIBARR_VERSION}.zip \
|
||||
&& chown -R www-data:www-data /usr/src/dolibarr-${DOLIBARR_VERSION} \
|
||||
&& rm -fr /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
|
||||
|
||||
CMD composer install && apache2-foreground
|
||||
# RUN pwd \
|
||||
# && 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"]
|
||||
|
||||
|
|
7
README.md
Normal file
7
README.md
Normal file
|
@ -0,0 +1,7 @@
|
|||
|
||||
|
||||
Ref: https://wiki.dolibarr.org/index.php?title=Setup_Other
|
||||
|
||||
PROJECT_ALLOW_COMMENT_ON_TASK
|
||||
PROJECT_ALLOW_COMMENT_ON_PROJECT
|
||||
|
|
@ -1,6 +1,11 @@
|
|||
error_reporting = E_ALL & ~E_WARNING & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED
|
||||
display_errors = Off
|
||||
|
||||
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
|
||||
upload_max_filesize = 128M
|
||||
post_max_size = 128M
|
||||
max_execution_time = 600
|
||||
max_execution_time = 1200
|
||||
max_input_time = 120
|
||||
|
|
Loading…
Reference in a new issue