mirror of https://github.com/akaunting/docker.git
Add volume files check setup
This commit is contained in:
parent
d38a61df23
commit
910b415ab5
|
@ -13,12 +13,14 @@ jobs:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
image: ['', fpm, fpm-alpine, fpm-alpine-nginx, fpm-alpine-nginx-composer, fpm-alpine-nginx-composer-supervisor]
|
image: ['', v, fpm, fpm-alpine, fpm-alpine-nginx, fpm-alpine-nginx-composer, fpm-alpine-nginx-composer-supervisor]
|
||||||
include:
|
include:
|
||||||
- image: ''
|
- image: ''
|
||||||
file: Dockerfile
|
file: Dockerfile
|
||||||
- image: fpm
|
- image: fpm
|
||||||
file: fpm.Dockerfile
|
file: fpm.Dockerfile
|
||||||
|
- image: v
|
||||||
|
file: v.Dockerfile
|
||||||
- image: fpm-alpine
|
- image: fpm-alpine
|
||||||
file: fpm-alpine.Dockerfile
|
file: fpm-alpine.Dockerfile
|
||||||
- image: fpm-alpine-nginx
|
- image: fpm-alpine-nginx
|
||||||
|
@ -67,10 +69,10 @@ jobs:
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
if: matrix.image == '' || matrix.image == 'fpm' || matrix.image == 'fpm-alpine' || matrix.image == 'fpm-alpine-nginx'
|
if: matrix.image == '' || matrix.image == 'v' || matrix.image == 'fpm' || matrix.image == 'fpm-alpine' || matrix.image == 'fpm-alpine-nginx'
|
||||||
uses: docker/setup-qemu-action@v1
|
uses: docker/setup-qemu-action@v1
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
if: matrix.image == '' || matrix.image == 'fpm' || matrix.image == 'fpm-alpine' || matrix.image == 'fpm-alpine-nginx'
|
if: matrix.image == '' || matrix.image == 'v' || matrix.image == 'fpm' || matrix.image == 'fpm-alpine' || matrix.image == 'fpm-alpine-nginx'
|
||||||
uses: docker/setup-buildx-action@v1
|
uses: docker/setup-buildx-action@v1
|
||||||
- name: Login to DockerHub
|
- name: Login to DockerHub
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request'
|
||||||
|
@ -79,7 +81,7 @@ jobs:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
- name: Build and push images
|
- name: Build and push images
|
||||||
if: matrix.image == '' || matrix.image == 'fpm' || matrix.image == 'fpm-alpine' || matrix.image == 'fpm-alpine-nginx'
|
if: matrix.image == '' || matrix.image == 'v' || matrix.image == 'fpm' || matrix.image == 'fpm-alpine' || matrix.image == 'fpm-alpine-nginx'
|
||||||
uses: docker/build-push-action@v2
|
uses: docker/build-push-action@v2
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
|
|
|
@ -98,6 +98,9 @@ Right now, the only built language is US English. If you would like more support
|
||||||
This repository contains extra compose and other files that allows you to run Akaunting in different setups like using FPM and NGINX and here is the most important commands that you may need:
|
This repository contains extra compose and other files that allows you to run Akaunting in different setups like using FPM and NGINX and here is the most important commands that you may need:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
|
# Run Akaunting setup that checks for volume files before copying them.
|
||||||
|
AKAUNTING_SETUP=true docker-compose -f v-docker-compose.yml up --build
|
||||||
|
|
||||||
# Run Akaunting with FPM on Debian and use Nginx as external proxy
|
# Run Akaunting with FPM on Debian and use Nginx as external proxy
|
||||||
AKAUNTING_SETUP=true docker-compose -f fpm-docker-compose.yml up --build
|
AKAUNTING_SETUP=true docker-compose -f fpm-docker-compose.yml up --build
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@ LOCALE=en-US
|
||||||
|
|
||||||
# Don't change this unless you rename your database container or use rootless podman, in case of using rootless podman you should set it to 127.0.0.1 (NOT localhost)
|
# Don't change this unless you rename your database container or use rootless podman, in case of using rootless podman you should set it to 127.0.0.1 (NOT localhost)
|
||||||
DB_HOST=akaunting-db
|
DB_HOST=akaunting-db
|
||||||
|
DB_PORT=3306
|
||||||
|
|
||||||
# Change these to match env/db.env
|
# Change these to match env/db.env
|
||||||
DB_DATABASE=akaunting
|
DB_DATABASE=akaunting
|
||||||
|
|
|
@ -0,0 +1,71 @@
|
||||||
|
#!/bin/bash -e
|
||||||
|
|
||||||
|
a2enmod rewrite
|
||||||
|
|
||||||
|
if [ ! -f /var/www/html/index.php ]; then
|
||||||
|
unzip /tmp/akaunting.zip -d /var/www/html
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm -f /tmp/akaunting.zip
|
||||||
|
|
||||||
|
|
||||||
|
do_start=
|
||||||
|
do_shell=
|
||||||
|
do_setup=
|
||||||
|
|
||||||
|
while [ $# -gt 0 ]; do
|
||||||
|
case "$1" in
|
||||||
|
--start)
|
||||||
|
do_start=true
|
||||||
|
;;
|
||||||
|
--shell)
|
||||||
|
do_start=false
|
||||||
|
do_shell=true
|
||||||
|
;;
|
||||||
|
--setup)
|
||||||
|
do_setup=true
|
||||||
|
do_start=true
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
|
mkdir -p storage/framework/{sessions,views,cache}
|
||||||
|
mkdir -p storage/app/uploads
|
||||||
|
|
||||||
|
if [ "$do_setup" -o "$AKAUNTING_SETUP" == "true" ]; then
|
||||||
|
retry_for=30
|
||||||
|
retry_interval=5
|
||||||
|
while sleep $retry_interval; do
|
||||||
|
if php artisan install \
|
||||||
|
--db-host=$DB_HOST \
|
||||||
|
--db-port=$DB_PORT \
|
||||||
|
--db-name=$DB_DATABASE \
|
||||||
|
--db-username=$DB_USERNAME \
|
||||||
|
"--db-password=$DB_PASSWORD" \
|
||||||
|
--db-prefix=$DB_PREFIX \
|
||||||
|
"--company-name=$COMPANY_NAME" \
|
||||||
|
"--company-email=$COMPANY_EMAIL" \
|
||||||
|
"--admin-email=$ADMIN_EMAIL" \
|
||||||
|
"--admin-password=$ADMIN_PASSWORD" \
|
||||||
|
"--locale=$LOCALE" --no-interaction; then break
|
||||||
|
else
|
||||||
|
if [ $retry_for -le 0 ]; then
|
||||||
|
echo "Unable to find database!" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
(( retry_for -= retry_interval ))
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
else
|
||||||
|
unset COMPANY_NAME COMPANY_EMAIL ADMIN_EMAIL ADMIN_PASSWORD
|
||||||
|
fi
|
||||||
|
|
||||||
|
chmod -R u=rwX,g=rX,o=rX /var/www/html
|
||||||
|
chown -R www-data:root /var/www/html
|
||||||
|
|
||||||
|
if [ "$do_start" ]; then
|
||||||
|
exec docker-php-entrypoint apache2-foreground
|
||||||
|
elif [ "$do_shell" ]; then
|
||||||
|
exec /bin/bash -li
|
||||||
|
fi
|
|
@ -0,0 +1,39 @@
|
||||||
|
version: '3.7'
|
||||||
|
|
||||||
|
services:
|
||||||
|
|
||||||
|
akaunting:
|
||||||
|
container_name: akaunting
|
||||||
|
build:
|
||||||
|
dockerfile: v.Dockerfile
|
||||||
|
context: .
|
||||||
|
ports:
|
||||||
|
- 8080:80
|
||||||
|
volumes:
|
||||||
|
- akaunting-data:/var/www/html
|
||||||
|
restart: unless-stopped
|
||||||
|
env_file:
|
||||||
|
- env/run.env
|
||||||
|
environment:
|
||||||
|
- AKAUNTING_SETUP
|
||||||
|
depends_on:
|
||||||
|
- akaunting-db
|
||||||
|
|
||||||
|
akaunting-db:
|
||||||
|
container_name: akaunting-db
|
||||||
|
image: mariadb
|
||||||
|
volumes:
|
||||||
|
- akaunting-db:/var/lib/mysql
|
||||||
|
restart: unless-stopped
|
||||||
|
env_file:
|
||||||
|
- env/db.env
|
||||||
|
|
||||||
|
akaunting-update:
|
||||||
|
image: containrrr/watchtower
|
||||||
|
volumes:
|
||||||
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
|
command: --cleanup akaunting akaunting-db
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
akaunting-data:
|
||||||
|
akaunting-db:
|
|
@ -0,0 +1,54 @@
|
||||||
|
FROM php:8.1-apache
|
||||||
|
|
||||||
|
ARG AKAUNTING_DOCKERFILE_VERSION=0.1
|
||||||
|
ARG SUPPORTED_LOCALES="en_US.UTF-8"
|
||||||
|
|
||||||
|
RUN apt-get update \
|
||||||
|
&& apt-get -y upgrade --no-install-recommends \
|
||||||
|
&& apt-get install -y \
|
||||||
|
build-essential \
|
||||||
|
imagemagick \
|
||||||
|
libfreetype6-dev \
|
||||||
|
libicu-dev \
|
||||||
|
libjpeg62-turbo-dev \
|
||||||
|
libjpeg-dev \
|
||||||
|
libmcrypt-dev \
|
||||||
|
libonig-dev \
|
||||||
|
libpng-dev \
|
||||||
|
libpq-dev \
|
||||||
|
libssl-dev \
|
||||||
|
libxml2-dev \
|
||||||
|
libxrender1 \
|
||||||
|
libzip-dev \
|
||||||
|
locales \
|
||||||
|
openssl \
|
||||||
|
unzip \
|
||||||
|
zip \
|
||||||
|
zlib1g-dev \
|
||||||
|
--no-install-recommends \
|
||||||
|
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
RUN for locale in ${SUPPORTED_LOCALES}; do \
|
||||||
|
sed -i 's/^# '"${locale}/${locale}/" /etc/locale.gen; done \
|
||||||
|
&& locale-gen
|
||||||
|
|
||||||
|
RUN docker-php-ext-configure gd \
|
||||||
|
--with-freetype \
|
||||||
|
--with-jpeg \
|
||||||
|
&& docker-php-ext-install -j$(nproc) \
|
||||||
|
gd \
|
||||||
|
bcmath \
|
||||||
|
intl \
|
||||||
|
mbstring \
|
||||||
|
pcntl \
|
||||||
|
pdo \
|
||||||
|
pdo_mysql \
|
||||||
|
zip
|
||||||
|
|
||||||
|
RUN curl -Lo /tmp/akaunting.zip 'https://akaunting.com/download.php?version=latest&utm_source=docker&utm_campaign=developers'
|
||||||
|
|
||||||
|
COPY files/akaunting-v.sh /usr/local/bin/akaunting-v.sh
|
||||||
|
COPY files/html /var/www/html
|
||||||
|
|
||||||
|
ENTRYPOINT ["/usr/local/bin/akaunting-v.sh"]
|
||||||
|
CMD ["--start"]
|
Loading…
Reference in New Issue