Skip to content

Commit

Permalink
fix container build - I'm unable to do it with prod build, building d…
Browse files Browse the repository at this point in the history
…ev for now
  • Loading branch information
CybotTM committed Nov 23, 2022
1 parent 0153ac1 commit 650c6e7
Show file tree
Hide file tree
Showing 6 changed files with 592 additions and 543 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
/app/build/
/app/bootstrap.php.cache
/bin/*
!/bin/console
/web/bundles/*
/web/.htaccess
/vendor/*
Expand Down
19 changes: 13 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM php:7.4-fpm AS runtime

#ENV SYMFONY_ENV=prod

RUN set -ex \
&& apt-get update -y \
&& apt-get upgrade -y \
Expand All @@ -23,17 +25,22 @@ FROM runtime AS builder
RUN apt-get update -y
RUN apt-get install -y git unzip curl
# install composer
RUN curl -sS https://getcomposer.org/installer | php -- --1
RUN curl -sS https://getcomposer.org/installer | php -- --version=2.2.9
RUN mv composer.phar /usr/local/bin/composer

COPY . /var/www/html

# install the composer packages
RUN cd /var/www/html && composer install --no-dev --no-ansi

RUN mkdir -p /var/www/html/app/logs
RUN mkdir -p /var/www/html/app/cache
RUN chmod ugo+rwX /var/www/html/app/logs /var/www/html/app/cache
WORKDIR /var/www/html
RUN cp app/config/sentry.yml.dist app/config/sentry.yml
#RUN composer install --no-dev --no-ansi
RUN composer install --no-ansi
#RUN app/console cache:clear --no-warmup
#RUN app/console assets:install 'web'

RUN mkdir -p app/logs
RUN mkdir -p app/cache
RUN chmod ugo+rwX app/logs app/cache


FROM runtime
Expand Down
27 changes: 27 additions & 0 deletions bin/console
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env php
<?php

use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Debug\Debug;

// if you don't want to setup permissions the proper way, just uncomment the following PHP line
// read https://symfony.com/doc/current/setup.html#checking-symfony-application-configuration-and-setup
// for more information
//umask(0000);

set_time_limit(0);

require __DIR__.'/../vendor/autoload.php';

$input = new ArgvInput();
$env = $input->getParameterOption(['--env', '-e'], getenv('SYMFONY_ENV') ?: 'dev');
$debug = getenv('SYMFONY_DEBUG') !== '0' && !$input->hasParameterOption(['--no-debug', '']) && $env !== 'prod';

if ($debug) {
Debug::enable();
}

$kernel = new AppKernel($env, $debug);
$application = new Application($kernel);
$application->run($input);
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"incenteev/composer-parameter-handler": "^2.0",
"jms/di-extra-bundle": "*",
"jms/security-extra-bundle": "*",
"laminas/laminas-zendframework-bridge": "^1.6",
"phpoffice/phpspreadsheet": "^1.4",
"psr/link": "1.0.0",
"sensio/distribution-bundle": "^5.0.19",
Expand Down
Loading

0 comments on commit 650c6e7

Please sign in to comment.