work on dockerfile
This commit is contained in:
@@ -14,6 +14,7 @@ stages:
|
|||||||
- SecurityChecker
|
- SecurityChecker
|
||||||
- CodingStandards
|
- CodingStandards
|
||||||
- UnitTests
|
- UnitTests
|
||||||
|
- publish
|
||||||
|
|
||||||
security-checker:
|
security-checker:
|
||||||
stage: SecurityChecker
|
stage: SecurityChecker
|
||||||
@@ -38,3 +39,24 @@ twig-lint:
|
|||||||
script:
|
script:
|
||||||
- twig-lint --version && twig-lint lint ./templates
|
- twig-lint --version && twig-lint lint ./templates
|
||||||
allow_failure: false
|
allow_failure: false
|
||||||
|
|
||||||
|
publish:
|
||||||
|
stage: publish
|
||||||
|
image: docker:dind
|
||||||
|
services:
|
||||||
|
- docker:dind
|
||||||
|
only:
|
||||||
|
- main
|
||||||
|
variables:
|
||||||
|
DOCKER_DRIVER: overlay2
|
||||||
|
registry_host: ''
|
||||||
|
registry_user: ''
|
||||||
|
registry_pass: ''
|
||||||
|
registry_img: ''
|
||||||
|
before_script:
|
||||||
|
- apk add jq
|
||||||
|
script:
|
||||||
|
- APP_VERSION=$(cat package.json | jq .version -r)
|
||||||
|
- docker login $registry_host -u $registry_user -p $registry_pass
|
||||||
|
- docker build -f ./Dockerfile -t $registry_host/$registry_img:$APP_VERSION .
|
||||||
|
- docker push $registry_host/$registry_img:$APP_VERSION
|
||||||
27
Dockerfile
Normal file
27
Dockerfile
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
FROM php:8-apache
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
ENV DATABASE_URL=localhost
|
||||||
|
|
||||||
|
# Apk install
|
||||||
|
RUN apt update -y && apt install zip wget -y
|
||||||
|
|
||||||
|
# Install pdo
|
||||||
|
RUN docker-php-ext-install pdo_mysql
|
||||||
|
|
||||||
|
# Install composer
|
||||||
|
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && php composer-setup.php && php -r "unlink('composer-setup.php');" && mv composer.phar /usr/local/bin/composer
|
||||||
|
RUN composer install -n --no-scripts
|
||||||
|
RUN chown -R www-data:www-data /var/www/html/var
|
||||||
|
|
||||||
|
ENV APACHE_DOCUMENT_ROOT /var/www/html/public
|
||||||
|
|
||||||
|
RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf
|
||||||
|
RUN sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf
|
||||||
|
|
||||||
|
RUN chmod +x start.sh
|
||||||
|
|
||||||
|
WORKDIR /var/www/html
|
||||||
|
|
||||||
|
ENTRYPOINT ["./start.sh"]
|
||||||
Reference in New Issue
Block a user