Add image that has npm and composer

This commit is contained in:
Mohammed Al-Mahdawi 2021-03-22 16:15:39 +03:00
parent b7d7379e17
commit 45f48bc4af
3 changed files with 58 additions and 0 deletions

View File

@ -106,6 +106,9 @@ AKAUNTING_SETUP=true docker-compose -f fpm-docker-compose.yml -f fpm-alpine-dock
# Run Akaunting using FPM on Alpine and using Nginx as internal proxy
AKAUNTING_SETUP=true docker-compose -f fpm-alpine-nginx-docker-compose.yml up --build
# Download Akaunting using git and install composer and npm and run Akaunting using FPM on Alpine and using Nginx as internal proxy
AKAUNTING_SETUP=true docker-compose -f fpm-alpine-nginx-docker-compose.yml -f fpm-alpine-nginx-composer-docker-compose.yml up --build
```
## License

View File

@ -0,0 +1,7 @@
version: '3.7'
services:
akaunting:
build:
dockerfile: fpm-alpine-nginx-composer.Dockerfile
context: .

View File

@ -0,0 +1,48 @@
FROM php:7.4-fpm-alpine3.12
# Arguments defined in docker-compose.yml
ARG AKAUNTING_DOCKERFILE_VERSION=0.1
ARG SUPPORTED_LOCALES="en_US.UTF-8"
# Add Repositories
RUN rm -f /etc/apk/repositories &&\
echo "http://dl-cdn.alpinelinux.org/alpine/v3.12/main" >> /etc/apk/repositories && \
echo "http://dl-cdn.alpinelinux.org/alpine/v3.12/community" >> /etc/apk/repositories
# Add Dependencies
RUN apk add --update --no-cache \
nano \
bash \
nodejs \
npm \
git \
nginx
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
# Install PHP Extensions
RUN chmod +x /usr/local/bin/install-php-extensions && sync && \
install-php-extensions gd zip intl imap xsl pgsql opcache bcmath mysqli pdo_mysql
# Configure Extension
RUN docker-php-ext-configure \
opcache --enable-opcache
# Installing composer
RUN curl -sS https://getcomposer.org/installer -o composer-setup.php
RUN php composer-setup.php --install-dir=/usr/local/bin --filename=composer
RUN rm -rf composer-setup.php
# Download Akaunting application
RUN mkdir -p /var/www/html
RUN cd /var/www/html && git clone https://github.com/akaunting/akaunting.git . && composer install && npm install && npm run dev
COPY files/akaunting-php-fpm-nginx.sh /usr/local/bin/akaunting-php-fpm-nginx.sh
COPY files/html /var/www/html
# Setup Working Dir
WORKDIR /var/www/html
EXPOSE 9000
ENTRYPOINT ["/usr/local/bin/akaunting-php-fpm-nginx.sh"]
CMD ["--start"]