Files
perceptron-viewer/Dockerfile
T
Ninluc 5d71962893
linter / quality (push) Successful in 4m26s
tests / ci (8.4) (push) Successful in 4m24s
tests / ci (8.5) (push) Successful in 4m24s
Docker and CICD
2026-09-16 20:03:18 +02:00

58 lines
1.1 KiB
Docker

# Composer dependencies
FROM composer:2 AS vendor
WORKDIR /usr/app
COPY . .
RUN composer install --no-dev --optimize-autoloader --no-interaction
# Build frontend assets
# Install node and npm
RUN apk add --no-cache nodejs npm
RUN npm install
RUN npm run build
# Final PHP image
FROM dunglas/frankenphp:1.12.2-php8.3-alpine AS final
# Install system dependencies
RUN apk add --no-cache \
bash \
libpng-dev \
libjpeg-turbo-dev \
freetype-dev \
oniguruma-dev \
zip \
unzip \
git \
curl \
libpq-dev \
php-pgsql
# Install PHP extensions
RUN docker-php-ext-install pdo pgsql pdo_pgsql mbstring exif pcntl bcmath gd
WORKDIR /app
# Copy app
COPY . .
RUN mv .env.docker .env
# Copy dependencies
COPY --from=vendor /usr/app/vendor ./vendor
# Copy built frontend
COPY --from=vendor /usr/app/public/build ./public/build
# Permissions
#RUN chown -R www-data:www-data /app
#RUN chown www-data:www-data /app/dockerEntryPoint.sh
RUN chmod +x /app/dockerEntryPoint.sh
HEALTHCHECK --interval=30s --timeout=30s --start-period=30s --retries=3 CMD curl -f http://127.0.0.1/up || exit 1
EXPOSE 80
EXPOSE 8080
CMD ["./dockerEntryPoint.sh"]