Skip to content
Snippets Groups Projects
Commit f9307b37 authored by Sebastien's avatar Sebastien
Browse files

Merge branch 'tuleap-77-legacy-container' into 'main'

Tuleap 77 legacy container

See merge request !17
parents e6a44136 99d7b6c9
Branches
Tags
1 merge request!17Tuleap 77 legacy container
Showing
with 2271 additions and 40 deletions
...@@ -50,13 +50,18 @@ APP_DEBUG=1 ...@@ -50,13 +50,18 @@ APP_DEBUG=1
# If this fails, replace ${MYSQL_DATABASE:-rekallfrwsmember} by rekallfrwsmember # If this fails, replace ${MYSQL_DATABASE:-rekallfrwsmember} by rekallfrwsmember
# and do the same for the other variables # and do the same for the other variables
MYSQL_DATABASE=${MYSQL_DATABASE:-rekallfrwsmember} MYSQL_DATABASE=rekallfrwsmember
MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-root} MYSQL_ROOT_PASSWORD=root
MYSQL_USER=${MYSQL_USER:-rekallfrwsmember} MYSQL_USER=rekallfrwsmember
MYSQL_PASSWORD=${MYSQL_PASSWORD:-sm4SyZVPu6wpjZfg} MYSQL_PASSWORD=sm4SyZVPu6wpjZfg
BY_PASS_CODE=ed156b9188ecddf0c556d5712f0a84cc BY_PASS_CODE=ed156b9188ecddf0c556d5712f0a84cc
# Use smtp or mail in production # Use smtp or mail in production
MAILER_DSN=null://null MAILER_DSN=null://null
SYMFONY_SECRET=0f817363a768f111a17d2522b8d7e2d72cf738b1 SYMFONY_SECRET=0f817363a768f111a17d2522b8d7e2d72cf738b1
LEGACY_SRC_SHARED=./capsule-prototype
LEGACY_URL=http://legacy/
LEGACY_URL_EXTERNAL=http://localhost:8081/legacy/
# Should be the path part of the above url
LEGACY_EXTERNAL_PREFIX=/legacy
...@@ -32,3 +32,9 @@ yarn-error.log ...@@ -32,3 +32,9 @@ yarn-error.log
###< squizlabs/php_codesniffer ### ###< squizlabs/php_codesniffer ###
.phpcd .phpcd
.*.sw?
mysql
log
/legacy/*/
capsule-prototype/
.env
...@@ -8,11 +8,9 @@ Copy the file `.env_default` to `.env` and adapt it to your needs ...@@ -8,11 +8,9 @@ Copy the file `.env_default` to `.env` and adapt it to your needs
Run the following commands Run the following commands
```bash ```bash
# Clone the docker stack git clone https://gitlab.tetras-libre.fr/rekall/memorekall-member-new
git clone https://gitlab.tetras-libre.fr/rekall/docker-stack-new cd memorekall-member-new
cd docker-stack-new git clone https://gitlab.tetras-libre.fr/rekall/capsule-prototype
# Clone the symfony app
git clone https://gitlab.tetras-libre.fr/rekall/memorekall-member-new app
# Build and start the containers # Build and start the containers
docker-compose up --build docker-compose up --build
# In another terminal # In another terminal
......
...@@ -21,3 +21,7 @@ services: ...@@ -21,3 +21,7 @@ services:
# add more service definitions when explicit configuration is needed # add more service definitions when explicit configuration is needed
# please note that last definitions always *replace* previous ones # please note that last definitions always *replace* previous ones
parameters:
app.legacy_url_external: '%env(LEGACY_URL_EXTERNAL)%'
app.legacy_url: '%env(LEGACY_URL)%'
app.legacy_external_prefix: '%env(LEGACY_EXTERNAL_PREFIX)%'
version: '3'
services:
###> symfony/mailer ###
mailer:
image: schickling/mailcatcher
ports: [1025, 1080]
###< symfony/mailer ###
###> doctrine/doctrine-bundle ###
database:
ports:
- "5432"
###< doctrine/doctrine-bundle ###
version: '3' version: "3.4"
services: services:
###> doctrine/doctrine-bundle ### mysql:
database: image: mysql:5.6
image: postgres:${POSTGRES_VERSION:-13}-alpine
environment: environment:
POSTGRES_DB: ${POSTGRES_DB:-app} - MYSQL_DATABASE
# You should definitely change the password in production - MYSQL_ROOT_PASSWORD
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-ChangeMe} - MYSQL_USER
POSTGRES_USER: ${POSTGRES_USER:-symfony} - MYSQL_PASSWORD
volumes: volumes:
- db-data:/var/lib/postgresql/data:rw - "./mysql:/var/lib/mysql:rw"
# You may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data! - "./docker/mysql/init_db_d:/docker-entrypoint-initdb.d"
# - ./docker/db/data:/var/lib/postgresql/data:rw memorekall-member:
###< doctrine/doctrine-bundle ### build: ./docker/symfony
depends_on:
- mysql
- legacy
environment:
- MYSQL_DATABASE
- MYSQL_USER
- MYSQL_PASSWORD
volumes:
- $PWD:/sites/memorekall/www/web_dev:rw
networks:
- default
- legacy
ports:
- "${MEMOREKALL_MEMBER_PORT}:80"
legacy:
build: ./docker/legacy
depends_on:
- mysql
volumes: volumes:
###> doctrine/doctrine-bundle ### - $PWD/legacy:/sites/memorekall/www/web_legacy:rw
db-data: - $PWD/log:/sites/memorekall/www/log:rw
###< doctrine/doctrine-bundle ### - ${LEGACY_SRC_SHARED}:/sites/memorekall/www/web_legacy/shared:ro
networks:
- legacy
networks:
legacy:
FROM php:7.4-apache
COPY front.conf /etc/apache2/sites-enabled/000-default.conf
RUN apt-get update && apt-get -y upgrade && apt-get update && apt-get install -y \
libcurl4-openssl-dev \
libfreetype6-dev \
libjpeg62-turbo-dev \
libonig-dev \
libpng-dev \
libpng-dev \
libzip-dev \
zlib1g-dev
RUN docker-php-ext-configure gd --with-freetype --with-jpeg
RUN docker-php-ext-install -j$(nproc) \
gd \
mbstring \
curl \
zip
RUN mkdir -p /sites/memorekall/www
WORKDIR /sites/memorekall/www
VOLUME web_legacy
VOLUME log
RUN mkdir -p tmp
<VirtualHost *:80>
ServerName legacy.memorekall.com
ServerAlias www.legacy.memorekall.com
ServerAdmin webmaster@localhost
DocumentRoot /sites/memorekall/www/web_legacy
<Directory /sites/memorekall/www/web_legacy>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
DirectoryIndex index.php, index.html
</Directory>
# uncomment the following lines if you install assets as symlinks
# or run into problems when compiling LESS/Sass/CoffeeScript assets
# <Directory /var/www/project>
# Options FollowSymlinks
# </Directory>
# optionally disable the fallback resource for the asset directories
# which will allow Apache to return a 404 error when files are
# not found instead of passing the request to Symfony
ErrorLog /sites/memorekall/www/log/legacy_errors.log
CustomLog /sites/memorekall/www/log/legacy_access.log combined
</VirtualHost>
FROM php:7.4-apache
USER root
RUN apt-get update && apt-get -y upgrade
RUN apt-get update && apt-get install -y \
gnupg \
wget \
apt-transport-https \
git \
unzip \
nodejs \
npm \
python2
ENV PHP_MEMORY_LIMIT=512M
#!/bin/bash
# To add this repository please do:
COPY addPhpRepository.sh .
RUN bash addPhpRepository.sh
RUN a2enmod rewrite headers proxy proxy_http
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -yq \
libcurl4-openssl-dev \
libfreetype6-dev \
libjpeg62-turbo-dev \
libonig-dev \
libpng-dev \
libpng-dev \
libzip-dev \
zlib1g-dev \
libxml2-dev \
libicu-dev
RUN docker-php-ext-configure gd --with-freetype --with-jpeg
RUN docker-php-ext-install -j$(nproc) \
mbstring \
gd \
pdo_mysql \
mysqli \
curl \
zip \
pdo \
ctype \
iconv \
json \
session \
simplexml \
tokenizer
# Install opcache extension for PHP accelerator
RUN docker-php-ext-install opcache \
&& docker-php-ext-enable opcache \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get autoremove -y
# Install internationalization extension
RUN BUILD_DEPS="g++ libicu-dev" && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -yq \
$BUILD_DEPS \
&& docker-php-ext-configure intl \
&& docker-php-ext-install intl \
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false $BUILD_DEPS \
&& rm -rf /var/lib/apt/lists/*
RUN echo 'date.timezone = "UTC"' >> /usr/local/etc/php/php.ini
RUN echo 'opcache.max_accelerated_files = 20000' >> /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini
RUN echo short_open_tag=off >> /usr/local/etc/php/php.ini
# Install composer
COPY install_composer.sh /bin
RUN chmod u+x /bin/install_composer.sh
RUN /bin/install_composer.sh
# Install xdebug
RUN pecl install xdebug-2.9.0 \
&& docker-php-ext-enable xdebug
COPY xdebug.ini $PHP_INI_DIR/conf.d/
# Composer is global
RUN mv composer.phar /usr/local/bin/composer && curl -sS https://get.symfony.com/cli/installer | bash && cp /root/.symfony/bin/symfony /usr/local/bin/symfony
ENV COMPOSER_MEMORY_LIMIT=-1
RUN mkdir -p /sites/memorekall/www/web_dev
WORKDIR /sites/memorekall/www/web_dev
COPY symfony.conf /etc/apache2/sites-enabled/000-default.conf
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["bash","/entrypoint.sh"]
if [ "$(whoami)" != "root" ]; then
SUDO=sudo
fi
${SUDO} apt-get -y install apt-transport-https lsb-release ca-certificates curl
${SUDO} wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
${SUDO} sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
${SUDO} apt-get update
\ No newline at end of file
base_dir=/sites/memorekall/www
pushd $base_dir
pushd $base_dir/web_dev
# Install dependencies using local composer not global because of php 5.5
composer install
popd
# Create required dirs
DIRS="web_dev/var/log web_dev/var/cache"
for d in $DIRS; do
mkdir -p $d
done
popd
xdebug_conf="$PHP_INI_DIR/conf.d/xdebug.ini"
npm install
if [ "$ENV" == "prod" ]; then
rm $xdebug_conf
npm run build
else
if [[ "$(uname -r)" =~ "linuxkit" ]]; then
# Connect back does not work in non Linux, deactivate it and use host.docker.internal url
sed -i -e "s/xdebug.remote_connect_back=1/xdebug.remote_connect_back=0/" $xdebug_conf
echo "xdebug.remote_host = host.docker.internal" >> $xdebug_conf
fi
npm run watch &
fi
# Fix permissions
for d in var vendor assets public node_modules legacy log src; do
chown -R :www-data $base_dir/web_dev/$d
chmod -R g+w $base_dir/web_dev/$d
done
chown -R 999:999 $base_dir/web_dev/mysql
apache2ctl -DFOREGROUND
#!/bin/sh
EXPECTED_CHECKSUM="$(php -r 'copy("https://composer.github.io/installer.sig", "php://stdout");')"
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"
if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]
then
>&2 echo 'ERROR: Invalid installer checksum'
rm composer-setup.php
exit 1
fi
php composer-setup.php --quiet
RESULT=$?
rm composer-setup.php
exit $RESULT
\ No newline at end of file
<VirtualHost *:80>
ServerName project.memorekall.com
ServerAlias www.project.memorekall.com
DocumentRoot /sites/memorekall/www/web_dev/public
DirectoryIndex /index.php
<Directory /sites/memorekall/www/web_dev/public>
Require all granted
AllowOverride None
Order Allow,Deny
Allow from All
FallbackResource /index.php
RewriteEngine on
</Directory>
ErrorLog /sites/memorekall/www/web_dev/log/memorekall_member_error.log
CustomLog /sites/memorekall/www/web_dev/log/memorekall_member.log combined
</VirtualHost>
xdebug.remote_port=9000
xdebug.remote_enable=1
xdebug.remote_connect_back=1
File added
@import url("font/stylesheet.css");
html, body {
width: 100%;
height: 100%;
margin: 0px;
color: white;
font-family: 'OpenSans';
font-weight: 400;
font-size: 12px;
background-color: black;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
#createProjectBody {
background: #1c272b;
text-align: center;
}
#createProjectLogo {
/*width: 30vh;
height: 30vh; */
margin: 50px 0;
height: 150px;
}
label {
/*width: 40vw; */
width: 400px;
margin: auto;
text-align: left;
display: block;
font-weight: 200;
color: rgba(255,255,255,.5);
font-size: 2vh;
line-height: 1.2em;
}
input[type=text], input[type=password] {
/*width: 40vw; */
/*height: 5vh; */
/*line-height: 5vh;*/
/*font-size: 2.5vh; */
font-weight: 200;
margin: 1vh 0 3vh 0;
text-align: center;
/*background: rgba(0,0,0,.15);*/
border: 0;
border-radius: 3px;
color: rgba(255,255,255,.75);
/*box-shadow: 0 1px 0 3px rgba(0,0,0,.05) inset;*/
width: 400px;
height: auto;
padding: 15px 10px;
font-size: 16px;
box-shadow: 0 1px 0 rgba(255,255,255,.05), 0 1px 2px rgba(0,0,0,.5) inset;
background: rgba(0,0,0,.25);
color: #fff;
line-height: 1.2em;
}
::-webkit-input-placeholder {
color: rgba(255,255,255,.1);
font-style: italic;
}
/*#submitCreate, .submitButton {
width: 20vw;
height: 6vh;
line-height: 6vh;
font-size: 2vh;
font-weight: 500;
padding: 0;
margin: 4vh 0 0 0;
background: #24B290;
border: 0;
border-radius: 3px;
color: #1c272b;
text-transform: uppercase;
cursor: pointer;
}
#submitCreate:hover, .submitButton:hover {
background: #65B162;
}*/
#submitCreate, .submitButton {
width: 200px;
margin: 20px 10px;
padding: 15px 10px;
border: none;
border-radius: 3px;
font-size: 16px;
background: #49AD9A;
box-shadow: 0 2px 0 #3B8C7E;
text-decoration: none !important;
color: #FFF !important;
opacity: 1 !important;
font-weight: 400 !important;
display: inline-block;
cursor: pointer;
}
#submitCreate:hover, .submitButton:hover {
background: #3B8C7E;
}
.projectItem {
padding: 2px;
}
.projectItem.red {
color: red;
}
.row-title-box {
border-bottom: 1px solid rgba(0,0,0,.2);
/*background: rgba(0,0,0,.1);*/
margin-bottom: 60px;
width: 920px !important;
margin-left: 20px;
display: inline-block;
text-align: left;
}
.row-title {
color: rgba(255,255,255,.75) !important;
font-size: 24px !important;
font-weight: 300 !important;
line-height: 60px !important;
margin-left: 0px;
font-size: 22px !important;
font-weight: 300 !important;
background: -webkit-linear-gradient(top left, #FA772E, #FC4326);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
\ No newline at end of file
File added
This diff is collapsed.
File added
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment