Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix-Dockerfile: no source files were specified #1306

Closed
wants to merge 1 commit into from
Closed
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
60 changes: 23 additions & 37 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,48 +1,32 @@
FROM php:8.1-fpm-alpine
FROM php:8.1-fpm-alpine3.18

WORKDIR "/usr/local/share/cypht"

RUN set -e \
&& apk add --no-cache \
supervisor nginx composer sqlite freetype libpng libjpeg-turbo \
php-session php-fileinfo php-dom php-xml libxml2-dev php-xmlwriter php-tokenizer \
&& apk add --no-cache --virtual .build-deps \
ca-certificates \
libpng-dev libjpeg-turbo-dev freetype-dev \
&& docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ \
&& docker-php-ext-install gd pdo pdo_mysql mysqli \
&& curl -sSL https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions -o - | sh -s \
xdebug redis gnupg memcached \
&& composer self-update --2 \
&& apk del .build-deps \
&& ln -sf /dev/stdout /var/log/nginx/access.log \
&& ln -sf /dev/stderr /var/log/nginx/error.log \
&& ln -s /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini
RUN set -e; \
apk add --no-cache supervisor nginx composer sqlite freetype libpng libjpeg-turbo \
php-session php-fileinfo php-dom php-xml libxml2-dev php-xmlwriter php-tokenizer

COPY <<EOF /tmp/xdebug.ini
[xdebug]
zend_extension=xdebug.so
RUN apk add --no-cache --virtual .build-deps \
ca-certificates libpng-dev libjpeg-turbo-dev freetype-dev

xdebug.mode=debug
xdebug.client_host=host.docker.internal
EOF
RUN docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ \
&& docker-php-ext-install gd pdo pdo_mysql mysqli

COPY <<EOF /usr/local/etc/php/conf.d/cypht.ini
post_max_size = 60M
upload_max_filesize = 50M
# the following is needed for sqlite access
open_basedir = /var/lib/hm3/:/usr/local/share/cypht/:/tmp
EOF
RUN curl -sSL https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions -o - | sh -s \
xdebug redis gnupg memcached

COPY docker/nginx.conf /etc/nginx/nginx.conf
COPY docker/supervisord.conf /etc/supervisord.conf
COPY composer.* .
RUN apk del .build-deps

ARG WITH_DEBUG=false
RUN ln -sf /dev/stdout /var/log/nginx/access.log \
&& ln -sf /dev/stderr /var/log/nginx/error.log \
&& ln -s /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini

RUN [ "$WITH_DEBUG" = "true" ] && mv /tmp/xdebug.ini /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini || true
# Copier les fichiers nécessaires pour Composer
COPY composer.json composer.lock ./

RUN composer install
# Mettre à jour Composer et installer les dépendances
RUN composer self-update --2 \
&& composer install --no-dev --prefer-dist --optimize-autoloader

COPY config/ config/
COPY language/ language/
Expand All @@ -52,11 +36,13 @@ COPY scripts/ scripts/
COPY third_party/ third_party/
COPY index.php index.php

COPY docker/nginx.conf /etc/nginx/nginx.conf
COPY docker/supervisord.conf /etc/supervisord.conf
COPY docker/docker-entrypoint.sh docker/docker-entrypoint.sh
COPY .env.example .env

EXPOSE 80

HEALTHCHECK CMD curl --fail http://localhost || exit 1
HEALTHCHECK --interval=30s --timeout=10s --retries=3 CMD curl --fail http://localhost || exit 1

ENTRYPOINT ["docker/docker-entrypoint.sh"]
ENTRYPOINT ["docker/docker-entrypoint.sh"]
47 changes: 47 additions & 0 deletions docker/docker-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Build and Push Docker Image to Docker Hub

on:
schedule:
# Planifier l'exécution à minuit tous les jours (00:00)
- cron: "0 0 * * *"
push:
branches:
- main
workflow_dispatch:
# Permet de déclencher manuellement le workflow

jobs:
build-and-push:
runs-on: ubuntu-latest

steps:
# Checkout the repository
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: main

# Set up Docker Buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

# Log in to Docker Hub
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

# Build and push the Docker image for linux/amd64 and linux/arm64
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: chote/cypht:master
file: docker/Dockerfile

# Logout from Docker Hub
- name: Log out from Docker Hub
run: docker logout
Loading