Skip to content

Commit

Permalink
Add docker compose to generate the python script to generate PrestaSh…
Browse files Browse the repository at this point in the history
…op docker
  • Loading branch information
jolelievre committed Jun 24, 2024
1 parent fd13531 commit 8999997
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 2 deletions.
9 changes: 9 additions & 0 deletions .docker/generate-docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh

BASEDIR=$(dirname "$0")

$BASEDIR/install-environment.sh

echo Generate PrestaShop docker base files
cd $BASEDIR/..
python3 prestashop_docker.py generate
14 changes: 14 additions & 0 deletions .docker/install-environment.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

BASEDIR=$(dirname "$0")

echo Install python and pip
apt update
apt-get install -y python3-pip

cd $BASEDIR/..
requirements=`cat requirements.txt`
for requirement in $requirements; do
echo Install $requirement
pip3 install $requirement --break-system-packages
done
12 changes: 11 additions & 1 deletion HOW-TO-USE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ It requires Python 3.6+.
## Installation

```bash
$ pip install -r requirements.txt
$ pip install -r requirements.txt --break-system-packages
```

## Usage
Expand Down Expand Up @@ -60,3 +60,13 @@ positional arguments:
optional arguments:
-h, --help show this help message and exit
```
## Using docker compose
To generate the new base files, you need to update the `versions.py` file, add a section ith your new version along with the associated PHP versions, then run
```php
docker compose up generate
```
This will create new folders for the new version you just added.
6 changes: 6 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
services:
generate:
image: ubuntu:latest
volumes:
- .:/prestashop-docker
command: ["/prestashop-docker/.docker/generate-docker.sh"]
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ six==1.16.0
url-normalize==1.4.3
urllib3==1.26.12
websocket-client==1.3.1
wheel==0.38.4
wheel==0.42.0

0 comments on commit 8999997

Please sign in to comment.