Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
run: docker-compose up -d

- name: Initialise Litus
run: docker-compose run --rm php-cli init
run: docker-compose run --rm litus init

- name: Test response
run: curl -fsSL -I --retry 5 --retry-delay 0 --retry-max-time 30 http://localhost:8080
102 changes: 15 additions & 87 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# dependencies
FROM caddy:2.6.2 AS caddy

# development
FROM composer:2.4.4 AS composer

ARG APPLICATION_ENV=development
Expand Down Expand Up @@ -47,41 +45,23 @@ RUN \
--optimize; \
fi

FROM php:8.1.9-cli-alpine AS php-cli
FROM dunglas/frankenphp:latest-alpine AS frankenphp

ARG APPLICATION_ENV=development
ENV APPLICATION_ENV=${APPLICATION_ENV}
ARG COMMIT_SHA
ENV COMMIT_SHA=${COMMIT_SHA}

RUN apk add --no-cache \
icu \
imagemagick \
libgomp \
libpq \
libxml2 \
libzip && \
apk add --no-cache --virtual .phpize-deps \
$PHPIZE_DEPS \
icu-dev \
imagemagick-dev \
libxml2-dev \
libzip-dev \
postgresql-dev && \
docker-php-ext-install "-j$(nproc)" \
intl \
opcache \
pdo_pgsql \
pgsql \
soap \
zip && \
pecl install imagick && \
docker-php-ext-enable imagick && \
pecl install mailparse && \
docker-php-ext-enable mailparse && \
pecl install redis && \
docker-php-ext-enable redis && \
apk del .phpize-deps
RUN install-php-extensions \
imagick \
intl \
mailparse \
opcache \
pdo_pgsql \
pgsql \
redis \
soap \
zip

RUN apk add --no-cache \
openjdk11-jre && \
Expand All @@ -90,36 +70,6 @@ RUN apk add --no-cache \
npm==10.24.1-r0 && \
npm install -g less

RUN mv "${PHP_INI_DIR}/php.ini-production" "${PHP_INI_DIR}/php.ini"

COPY --from=composer /app/ /app/

COPY docker/php-cli/litus.ini /usr/local/etc/php/conf.d/
COPY docker/php-cli/entrypoint.sh /

ENTRYPOINT ["/entrypoint.sh"]

FROM php:8.1.9-fpm-alpine AS php-fpm

ARG APPLICATION_ENV=development
ENV APPLICATION_ENV=${APPLICATION_ENV}
ARG COMMIT_SHA
ENV COMMIT_SHA=${COMMIT_SHA}

RUN apk add --no-cache \
icu \
imagemagick \
libgomp \
libpq \
libxml2 \
libzip \
openjdk11-jre

RUN apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.10/main --update-cache \
nodejs==10.24.1-r0 \
npm==10.24.1-r0 && \
npm install -g less

RUN curl -fsSL -o /tmp/fop-2.7-bin.tar.gz https://downloads.apache.org/xmlgraphics/fop/binaries/fop-2.7-bin.tar.gz && \
tar --strip-components=1 -C /opt -xzf /tmp/fop-2.7-bin.tar.gz fop-2.7/fop && \
rm /tmp/fop-2.7-bin.tar.gz
Expand All @@ -134,13 +84,10 @@ RUN mkdir -p /app/public/_assetic && \
mkdir -p /app/public/_br/img && \
chown -R www-data:www-data /app

COPY --from=php-cli --chown=www-data:www-data /app/ /app/

COPY --from=php-cli /usr/local/etc/php/conf.d/ /usr/local/etc/php/conf.d/
COPY --from=php-cli /usr/local/lib/php/extensions/ /usr/local/lib/php/extensions/
COPY --from=composer /app/ /app/

COPY docker/php-fpm/litus.ini /usr/local/etc/php/conf.d/
COPY docker/php-fpm/opcache.ini /usr/local/etc/php/conf.d/
COPY docker/frankenphp/litus.ini /usr/local/etc/php/conf.d/
COPY docker/frankenphp/entrypoint.sh /

VOLUME ["/app/public/_assetic"]
VOLUME ["/app/public/_common/profile"]
Expand All @@ -151,23 +98,4 @@ VOLUME ["/app/public/_br/img"]

VOLUME ["/data"]

FROM scratch

COPY --from=caddy /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=caddy /usr/bin/caddy /usr/bin/

COPY --from=composer /app/public/ /app/public/

COPY docker/caddy/Caddyfile /etc/caddy/

VOLUME ["/app/public/_assetic"]
VOLUME ["/app/public/_common/profile"]
VOLUME ["/app/public/_gallery/albums"]
VOLUME ["/app/public/_publications/pdf"]
VOLUME ["/app/public/_publications/html"]
VOLUME ["/app/public/_br/img"]

EXPOSE 8080

ENTRYPOINT ["caddy"]
CMD ["run", "--config", "/etc/caddy/Caddyfile", "--adapter", "caddyfile"]
ENTRYPOINT ["/entrypoint.sh"]
6 changes: 6 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@
"squizlabs/php_codesniffer": "^3.3",
"slevomat/coding-standard": "^6.1"
},
"config": {
"allow-plugins": {
"laminas/laminas-dependency-plugin": true,
"phpstan/extension-installer": true
}
},
"autoload": {
"psr-4": {
"Migrations\\": "migrations",
Expand Down
49 changes: 2 additions & 47 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,67 +10,23 @@ volumes:
services:
litus:
image: litusproject/litus:latest
container_name: litus-litus-1
build:
context: .
depends_on:
- php-fpm
ports:
- 127.0.0.1:8080:8080
volumes:
- assetic:/app/public/_assetic
restart: unless-stopped

pgweb:
image: sosedoff/pgweb:latest
container_name: litus-pgweb-1
depends_on:
- postgres
environment:
- DATABASE_URL=postgres://litus:huQeyU8te3aXusaz@postgres:5432/litus?sslmode=disable
ports:
- 127.0.0.1:8081:8081
restart: unless-stopped

php-cli:
image: litusproject/litus:php-cli-latest
build:
context: .
target: php-cli
depends_on:
- postgres
- redis
environment:
LITUS_DATABASE_HOST: postgres
LITUS_DATABASE_USER: litus
LITUS_DATABASE_PASSWORD: huQeyU8te3aXusaz
LITUS_DATABASE_DBNAME: litus

LITUS_REDIS_HOST: redis

php-fpm:
image: litusproject/litus:php-fpm-latest
container_name: litus-php-fpm-1
build:
context: .
target: php-fpm
depends_on:
- postgres
- redis
environment:
LITUS_DATABASE_HOST: postgres
LITUS_DATABASE_USER: litus
LITUS_DATABASE_PASSWORD: huQeyU8te3aXusaz
LITUS_DATABASE_DBNAME: litus

LITUS_REDIS_HOST: redis
ports:
- 127.0.0.1:8080:80
volumes:
- assetic:/app/public/_assetic
restart: unless-stopped

postgres:
image: postgres:latest
container_name: litus-postgres-1
environment:
POSTGRES_USER: litus
POSTGRES_PASSWORD: huQeyU8te3aXusaz
Expand All @@ -79,5 +35,4 @@ services:

redis:
image: redis:latest
container_name: litus-redis-1
restart: unless-stopped
7 changes: 0 additions & 7 deletions docker/caddy/Caddyfile

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ case "$1" in
;;

"")
exit 0
docker-php-entrypoint --config /etc/Caddyfile
;;

*)
Expand Down
File renamed without changes.
74 changes: 0 additions & 74 deletions docker/load_db_docker.sh

This file was deleted.

4 changes: 0 additions & 4 deletions docker/php-cli/litus.ini

This file was deleted.

36 changes: 0 additions & 36 deletions docker/php-fpm/opcache.ini

This file was deleted.

Loading