Skip to content
Snippets Groups Projects
Commit 26e9b972 authored by Hakan's avatar Hakan
Browse files

updated dockerfile

parent 872aafee
No related merge requests found
FROM php:7.3-apache
FROM php:7.4-apache
# Update system
RUN apt-get update
RUN apt-get update && rm /etc/apt/preferences.d/no-debian-php && apt-get install --yes git libzip-dev zip
# Install nodejs & npm
RUN curl -sL https://deb.nodesource.com/setup_15.x | bash - \
&& apt-get install -y nodejs
# Install compass
RUN apt-get install -y ruby-full \
&& gem install compass
# Install webpack
RUN npm install --global webpack webpack-cli
# Install composer
ENV COMPOSER_HOME "/home/www-data/.composer"
......@@ -9,8 +20,10 @@ RUN mkdir -p $COMPOSER_HOME && chmod -R 777 $COMPOSER_HOME && curl -sS https://g
&& chmod +x composer.phar && mv composer.phar /usr/local/bin/composer
RUN mkdir /srv/app
COPY vhost.conf /etc/apache2/sites-available/000-default.conf
COPY .docker/vhost.conf /etc/apache2/sites-available/000-default.conf
RUN docker-php-ext-install pdo pdo_mysql bcmath && \
RUN pecl install xdebug-2.9.2 && \
docker-php-ext-enable xdebug && \
docker-php-ext-install pdo pdo_mysql bcmath && \
chown -R www-data:www-data /srv/app && \
a2enmod rewrite
......@@ -5,12 +5,14 @@ session_start();
$pdo = new \PDO('mysql:host=mysql_todo_1;port=3306;dbname=todos;charset=utf8;', 'todos-user', 'todos-pwd');
if (isset($_GET['logout'])) {
$_SESSION['user_id'] = null;
if (array_key_exists('user_id', $_SESSION)) {
$_SESSION['user_id'] = null;
}
}
function estConnecte()
{
return $_SESSION['user_id'] != null;
return array_key_exists('user_id', $_SESSION) && $_SESSION['user_id'] != null;
}
$erreurConnexion = null;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment