-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update How to use to explain how to build and run the dockers locally
- Loading branch information
1 parent
1247134
commit 0f998da
Showing
4 changed files
with
119 additions
and
3 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
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 |
---|---|---|
|
@@ -111,3 +111,46 @@ $ nosetests --with-id 7 | |
``` | ||
This will also generate a `.nodeids` binary file, when you add new test methods you need to remove this file to re-generate the list of IDs. | ||
## Building and running PrestaShop docker locally | ||
First to make sure you will use the local docker containers and not the ones from Docker hub make sure you remove all existing PrestaShop images (including the base images) | ||
``` | ||
# This should be empty to be extra sure | ||
$ docker images | ||
``` | ||
Then you'll have to build the base image for the PHP version and server you are willing to use. If you are on MacOS this is crucial that you clean any image from cache and tun this locally, | ||
especially if your architecture is based on linux/arm64 (processor M1, M2, ...). | ||
```shell | ||
docker build base/images/8.3-apache -t prestashop/base:8.3-apache | ||
# You should see an image with Repository: prestashop Tag: 8.3-apache | ||
docker images | ||
``` | ||
Then you can build the image of the PrestaShop version you want to use: | ||
``` | ||
# Now build the PrestaShop version you want based on this local base image | ||
$ docker build images/9.0.x/8.3-apache -t prestashop/prestashop:9.0.x-8.3-apache | ||
``` | ||
Finally, you can launch your PrestaShop container using docker compose | ||
``` | ||
$ PS_VERSION=9.0.x PHP_VERSION=8.3 docker compose -f images/docker-compose.yml up | ||
``` | ||
Or you can use this script that performs these actions based on the arguments | ||
``` | ||
# Default values are nightly 8.3 apache | ||
./build-local-docker.sh 9.0.x 8.1 fpm | ||
``` | ||
Now you should be able to access a shop at this address: `http://localhost:8001/` | ||
The BO is accessible at `http://localhost:8001/admin-dev` with the following login: | ||
Email: `[email protected]` | ||
Password: `Correct Horse Battery Staple` |
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,26 @@ | ||
#!/bin/sh | ||
|
||
PS_VERSION=nigthly | ||
PHP_VERSION=8.3 | ||
SERVER=apache | ||
|
||
if [ $# -gt 0 ]; then | ||
PS_VERSION=$1 | ||
fi | ||
if [ $# -gt 1 ]; then | ||
PHP_VERSION=$2 | ||
fi | ||
if [ $# -gt 2 ]; then | ||
SERVER=$3 | ||
fi | ||
|
||
echo Building PrestaShop $PS_VERSION with PHP $PHP_VERSION and Server $SERVER | ||
|
||
echo Building base image for PHP $PHP_VERSION with $SERVER | ||
docker build base/images/$PHP_VERSION-$SERVER -t prestashop/base:$PHP_VERSION-$SERVER | ||
|
||
echo Building PrestaShop image for version $PS_VERSION | ||
docker build images/$PS_VERSION/$PHP_VERSION-$SERVER -t prestashop/prestashop:$PS_VERSION-$PHP_VERSION-$SERVER | ||
|
||
echo Launching docker container with docker compose | ||
PS_VERSION=$PS_VERSION PHP_VERSION=$PHP_VERSION SERVER=$SERVER docker compose -f images/docker-compose.yml up |
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,47 @@ | ||
version: '2.1' | ||
|
||
services: | ||
mysql: | ||
image: mysql:8 | ||
ports: | ||
- "3306:3306" | ||
environment: | ||
MYSQL_ROOT_PASSWORD: ${DB_PASSWD:-prestashop} | ||
MYSQL_DATABASE: ${DB_NAME:-prestashop} | ||
restart: unless-stopped | ||
networks: | ||
- prestashop-network | ||
|
||
prestashop: | ||
image: prestashop/prestashop:${PS_VERSION}-${PHP_VERSION}-${SERVER:-apache} | ||
container_name: prestashop | ||
depends_on: | ||
- mysql | ||
environment: | ||
DISABLE_MAKE: ${DISABLE_MAKE:-0} | ||
PS_INSTALL_AUTO: ${PS_INSTALL_AUTO:-1} | ||
DB_PASSWD: ${DB_PASSWD:-prestashop} | ||
DB_NAME: ${DB_NAME:-prestashop} | ||
DB_SERVER: ${DB_SERVER:-mysql} | ||
DB_PREFIX: ${DB_PREFIX:-ps_} | ||
PS_DOMAIN: ${PS_DOMAIN:-localhost:8001} | ||
PS_FOLDER_INSTALL: ${PS_FOLDER_INSTALL:-install-dev} | ||
PS_FOLDER_ADMIN: ${PS_FOLDER_ADMIN:-admin-dev} | ||
PS_COUNTRY: ${PS_COUNTRY:-fr} | ||
PS_LANGUAGE: ${PS_LANGUAGE:-en} | ||
PS_DEV_MODE: ${PS_DEV_MODE:-1} | ||
PS_ENABLE_SSL: ${PS_ENABLE_SSL:-0} | ||
PS_ERASE_DB: ${PS_ERASE_DB:-0} | ||
PS_USE_DOCKER_MAILDEV: ${PS_USE_DOCKER_MAILDEV:-1} | ||
ADMIN_MAIL: ${ADMIN_MAIL:[email protected]} | ||
ADMIN_PASSWD: ${ADMIN_PASSWD:-Correct Horse Battery Staple} | ||
NODE_VERSION: ${NODE_VERSION:-v20.17.0} | ||
ports: | ||
- "8001:80" | ||
- "8002:443" | ||
networks: | ||
- prestashop-network | ||
|
||
networks: | ||
prestashop-network: | ||
name: prestashop-network |