Skip to content
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
14 changes: 7 additions & 7 deletions apps/akeneo/.env
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
W9_VERSION=v7.0.22
W9_DIST=community
W9_VERSION='v7.0.22'
W9_DIST='community'
W9_REPO = websoft9dev/akeneo
W9_POWER_PASSWORD=UGz0IARz117ssO%
W9_POWER_PASSWORD='l3Of!CFkf8r!EhyI'

#### -- Not allowed to edit below environments when recreate app based on existing data -- ####
W9_ID=akeneo_z4oyc
W9_ID='akeneo_z4oyc'
W9_HTTP_PORT=80
W9_HTTP_PORT_SET=9001
W9_HTTP_PORT_SET='9001'
W9_LOGIN_USER=admin
W9_LOGIN_PASSWORD=$W9_POWER_PASSWORD
W9_NETWORK=websoft9
W9_DB_EXPOSE="mysql"
W9_MYSQL_VERSION="8.0"
W9_ES_VERSION="7.10.1"
W9_URL=appname.example.com
W9_URL='appname.example.com'
#### ------------------------------------------------------------------------------------------ ####

AKENEO_MYSQL_DATABASE=${W9_ID}
Expand All @@ -22,4 +22,4 @@ AKENEO_MYSQL_PASSWORD=${W9_POWER_PASSWORD}
AKENEO_MYSQL_HOST=$W9_ID-mysql
AKENEO_SITENAME="akeneo"
AKENEO_ADMIN_USER=${W9_LOGIN_USER}
AKENEO_ADMIN_PASSWORD=${W9_POWER_PASSWORD}
AKENEO_ADMIN_PASSWORD=${W9_POWER_PASSWORD}
47 changes: 47 additions & 0 deletions apps/akeneo/src/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# refer to: https://github.com/chandrantwins/akeneo-docker/blob/master/Dockerfile
# akeneo version: https://packagist.org/packages/akeneo/pim-community-standard
# upgrade to: 7.0.23

FROM akeneo/pim-php-dev:8.1

LABEL maintainer="[email protected]"
LABEL version="7.0.23"
LABEL description="Akeneo"

ENV AKENEO_MYSQL_HOST=mysql
ENV AKENEO_MYSQL_PORT=3306
ENV AKENEO_MYSQL_USER=akeneo
ENV AKENEO_MYSQL_PASSWORD=akeneo
ENV AKENEO_MYSQL_DATABASE=akeneo
ENV AKENEO_ADMIN_USER=admin
ENV AKENEO_ADMIN_PASSWORD=admin


RUN apt update -y && apt install apache2 unzip make -y
RUN apt clean && rm -rf /var/lib/apt/lists/*
RUN a2enmod rewrite proxy_fcgi actions alias expires headers ssl
ADD 000-default.conf /etc/apache2/sites-available/000-default.conf
ADD entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh && \
sed -i "s#memory_limit = .*.M#memory_limit = 1024M#g" /etc/php/8.1/fpm/php.ini && \
sed -i "s#listen = .*#listen = /run/php/php8.1-fpm.sock#g" /etc/php/8.1/fpm/pool.d/www.conf

ENTRYPOINT ["/entrypoint.sh"]


RUN curl -sL https://deb.nodesource.com/setup_16.x -o nodesource_setup.sh
RUN bash nodesource_setup.sh && apt install nodejs && npm install -g yarn
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
RUN rm -rf /var/www/html/*
RUN COMPOSER_MEMORY_LIMIT=-1 && \
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/ && \
composer create-project akeneo/pim-community-standard /var/www/html

WORKDIR /var/www/html
RUN chown -R www-data:www-data /var/www/html
RUN yarn install
RUN PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1 yarnpkg packages:build

EXPOSE 80

CMD ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"]
34 changes: 34 additions & 0 deletions apps/akeneo/src/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash

localexist=/var/www/html/.env.local
if [ ! -e "$localexist" ]; then

echo "file:.env.local isn't exist"

# replace Akeneo env
cp /var/www/html/.env /var/www/html/.env.local
sed -i "s/APP_DATABASE_HOST=.*/APP_DATABASE_HOST=$AKENEO_MYSQL_HOST/g" /var/www/html/.env.local
sed -i "s/APP_DATABASE_PORT=.*/APP_DATABASE_PORT=$AKENEO_MYSQL_PORT/g" /var/www/html/.env.local
sed -i "s/APP_DATABASE_NAME=.*/APP_DATABASE_NAME=$AKENEO_MYSQL_DATABASE/g" /var/www/html/.env.local
sed -i "s/APP_DATABASE_USER=.*/APP_DATABASE_USER=$AKENEO_MYSQL_USER/g" /var/www/html/.env.local
sed -i "s/APP_DATABASE_PASSWORD=.*/APP_DATABASE_PASSWORD=$AKENEO_MYSQL_PASSWORD/g" /var/www/html/.env.local

# to do: make prod
cd /var/www/html && NO_DOCKER=true make prod
chown -R www-data:www-data /var/www/html

# create administrator credential
bin/console pim:user:create $AKENEO_ADMIN_USER $AKENEO_ADMIN_PASSWORD [email protected] Admin Admin en_US --admin -n --env=prod

# Add local user
# Either use the LOCAL_USER_ID if passed in at runtime or
# fallback

USER_ID=${LOCAL_USER_ID:-1000}
usermod -u $USER_ID -o www-data && groupmod -g $USER_ID -o www-data
else
echo "file:.env.local is exist."
fi

/etc/init.d/php8.1-fpm start
exec "$@"