forked from PrestaShop/docker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2a8d6ae
commit 2a06251
Showing
6 changed files
with
185 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
ignored: | ||
- DL3006 | ||
- DL3008 | ||
- DL3009 | ||
- DL3018 | ||
- DL4006 | ||
- DL4001 | ||
- SC1091 | ||
- SC2086 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# www.robotstxt.org/ | ||
# www.google.com/support/webmasters/bin/answer.py?hl=en&answer=156449 | ||
|
||
User-agent: * | ||
Allow: / |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,50 @@ | ||
ARG PS_VERSION | ||
ARG PHP_VERSION | ||
ARG PHP_FLAVOUR | ||
ARG GIT_SHA | ||
ARG ZIP_SOURCE | ||
|
||
# ================================== | ||
# Stage 1/3: PHP base configuration | ||
# ================================== | ||
FROM php:${PHP_FLAVOUR} AS alpine-base-prestashop | ||
ARG PS_VERSION | ||
ARG PHP_VERSION | ||
|
||
ENV PS_DOMAIN="<to be defined>" \ | ||
DB_SERVER="<to be defined>" \ | ||
DB_PORT=3306 \ | ||
DB_NAME=prestashop \ | ||
DB_USER=root \ | ||
DB_PASSWD=admin \ | ||
DB_PREFIX=ps_ \ | ||
[email protected] \ | ||
ADMIN_PASSWD=prestashop_demo \ | ||
PS_LANGUAGE=en \ | ||
PS_COUNTRY=GB \ | ||
PS_ALL_LANGUAGES=0 \ | ||
PS_INSTALL_AUTO=0 \ | ||
PS_ERASE_DB=0 \ | ||
PS_INSTALL_DB=0 \ | ||
PS_DEV_MODE=0 \ | ||
PS_HOST_MODE=0 \ | ||
PS_DEMO_MODE=0 \ | ||
PS_ENABLE_SSL=0 \ | ||
PS_HANDLE_DYNAMIC_DOMAIN=0 \ | ||
PS_FOLDER_ADMIN=admin \ | ||
PS_FOLDER_INSTALL=install \ | ||
PHP_ENV=production | ||
DB_SERVER="<to be defined>" \ | ||
DB_PORT=3306 \ | ||
DB_NAME=prestashop \ | ||
DB_USER=root \ | ||
DB_PASSWD=admin \ | ||
DB_PREFIX=ps_ \ | ||
[email protected] \ | ||
ADMIN_PASSWD=prestashop_demo \ | ||
PS_LANGUAGE=en \ | ||
PS_COUNTRY=GB \ | ||
PS_ALL_LANGUAGES=0 \ | ||
PS_INSTALL_AUTO=0 \ | ||
PS_ERASE_DB=0 \ | ||
PS_INSTALL_DB=0 \ | ||
PS_DEV_MODE=0 \ | ||
PS_HOST_MODE=0 \ | ||
PS_DEMO_MODE=0 \ | ||
PS_ENABLE_SSL=0 \ | ||
PS_HANDLE_DYNAMIC_DOMAIN=0 \ | ||
PS_FOLDER_ADMIN=admin \ | ||
PS_FOLDER_INSTALL=install \ | ||
PHP_ENV=production | ||
|
||
# The PHP configuration script | ||
COPY ./assets/php-configuration.sh /tmp/ | ||
|
||
# Install base tools | ||
RUN \ | ||
apk --no-cache add -U \ | ||
ca-certificates geoip tzdata zip curl jq make \ | ||
gnu-libiconv php-common mariadb-client oniguruma-dev \ | ||
zlib-dev libzip-dev libjpeg-turbo-dev libpng-dev \ | ||
icu-dev libmcrypt-dev libxml2 libxml2-dev \ | ||
ca-certificates geoip tzdata zip curl jq make \ | ||
gnu-libiconv php-common mariadb-client oniguruma-dev \ | ||
zlib-dev libzip-dev libjpeg-turbo-dev libpng-dev \ | ||
icu-dev libmcrypt-dev libxml2 libxml2-dev \ | ||
&& /tmp/php-configuration.sh \ | ||
&& apk del make \ | ||
&& rm -rf /var/cache/apk/* | ||
|
@@ -59,42 +62,56 @@ COPY ./assets/docker_run.sh /tmp/ | |
|
||
# Apache configuration | ||
RUN if [ -x "$(command -v apache2-foreground)" ]; then \ | ||
a2enmod rewrite;\ | ||
fi | ||
a2enmod rewrite;\ | ||
fi | ||
|
||
# ========================================= | ||
# Stage 2/3: PrestaShop sources downloader | ||
# ========================================= | ||
FROM alpine-base-prestashop AS alpine-download-prestashop | ||
ARG PS_VERSION | ||
ENV PS_FOLDER=/tmp/prestashop | ||
ARG GIT_SHA | ||
ARG PHP_VERSION | ||
ARG PS_FOLDER=/var/www/html | ||
ARG ZIP_SOURCE | ||
|
||
# Get PrestaShop source code | ||
RUN if [[ "$PS_VERSION" == "nightly" ]]; then \ | ||
echo "Unsupported yet: https://prestashop.slack.com/archives/C03LFE4KV6K/p1703170152828039" \ | ||
&& exit 1; \ | ||
else \ | ||
curl -s -L -o /tmp/prestashop.zip "https://github.com/PrestaShop/PrestaShop/releases/download/${PS_VERSION}/prestashop_${PS_VERSION}.zip"; \ | ||
fi | ||
# hadolint ignore=DL3020 | ||
ADD ${ZIP_SOURCE} /tmp/prestashop.zip | ||
|
||
# Extract the souces | ||
RUN mkdir -p "$PS_FOLDER" /tmp/unzip-ps \ | ||
&& unzip -n -q /tmp/prestashop.zip -d /tmp/unzip-ps \ | ||
&& ([ -f /tmp/unzip-ps/prestashop.zip ] \ | ||
&& unzip -n -q /tmp/unzip-ps/prestashop.zip -d "$PS_FOLDER" \ | ||
|| mv /tmp/unzip-ps/prestashop/* "$PS_FOLDER") | ||
&& unzip -n -q /tmp/unzip-ps/prestashop.zip -d "$PS_FOLDER" \ | ||
|| mv /tmp/unzip-ps/prestashop/* "$PS_FOLDER") \ | ||
&& chown -R www-data:www-data "$PS_FOLDER" \ | ||
&& rm -rf /tmp/prestashop.zip /tmp/unzip-ps | ||
|
||
# Ship a VERSION file | ||
RUN echo "PrestaShop $PS_VERSION" > "$PS_FOLDER/VERSION" \ | ||
&& echo "PHP $PHP_VERSION" >> "$PS_FOLDER/VERSION" \ | ||
&& echo "Flashlight $GIT_SHA" >> "$PS_FOLDER/VERSION" | ||
|
||
# Adds a robots.txt file | ||
ADD ./assets/robots.txt $PS_FOLDER | ||
|
||
# ============================ | ||
# Stage 3/3: Production image | ||
# ============================ | ||
FROM alpine-base-prestashop | ||
ARG PS_FOLDER=/var/www/html/prestashop | ||
ARG PS_FOLDER=/var/www/html | ||
ARG PS_VERSION | ||
|
||
LABEL maintainer="PrestaShop Core Team <[email protected]>" | ||
|
||
ENV PS_VERSION $PS_VERSION | ||
COPY --chown=www-data:www-data --from=alpine-download-prestashop ${PS_FOLDER} ${PS_FOLDER} | ||
|
||
HEALTHCHECK --interval=5s --timeout=5s --retries=10 --start-period=10s \ | ||
CMD curl -Isf http://localhost:80/robots.txt || exit 1 | ||
|
||
EXPOSE 80 | ||
|
||
# Copy the PrestaShop sources | ||
COPY --chown=www-data:www-data --from=alpine-download-prestashop /tmp/prestashop ${PS_FOLDER} | ||
STOPSIGNAL SIGQUIT | ||
|
||
CMD ["/tmp/docker_run.sh"] | ||
ENTRYPOINT ["/tmp/docker_run.sh"] |
Oops, something went wrong.