Skip to content

Commit 4262341

Browse files
authored
Merge branch 'master' into PHRAS-4155_4.1.19_release
2 parents 7a46c04 + 5dd527d commit 4262341

12 files changed

+348
-20
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,4 @@
3838
/www/thumbnails
3939
/www/.htaccess
4040
npm-debug.log
41+
stack_management.sh

README.md

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ Get official support : https://www.alchemy.fr/en/rubrique/services/
9797
## Prerequisites
9898

9999

100-
- docker >=v20.10.24
100+
- docker >=25.0.5
101+
- docker compose >= 2.29.0
101102

102103
In the stack Docker, Docker Compose included in this repo starts by default in test mode.
103104
All services are launched in a separate container and except "Phraseanet app" and "workers" containers,
@@ -185,7 +186,7 @@ COMPOSE_PROFILES=app,gateway-classic,db,pma,elasticsearch,redis,redis-session,ra
185186

186187

187188
You should review the default env variables defined in `.env` file.
188-
Use `export` method to override these values.
189+
Use `export` method to override these values
189190

190191
i.e:
191192
```bash
@@ -194,9 +195,28 @@ export [email protected]
194195
export INSTALL_ACCOUNT_PASSWORD=$3cr3t!
195196
export PHRASEANET_APP_PORT=8082
196197
```
198+
199+
If you want persit this change you can also save your change in a files named `env.local` or `.env.local`
200+
201+
These files are git ignored and permit stack customization without git conflict generation.
202+
197203
If you are not interested in the development of Phraseanet, you can ignore everything in `.env` after the `DEV Purpose` part.
198204

199205

206+
### stack Management
207+
208+
To start and stop the stack, use the `stack_management.sh start|stop|info|check|log` script at the project root.
209+
this script work only Linux and MacOS.
210+
211+
This script wrapping standard oprations for the stack, using standard docker compose cmd and take in account `.env` and `env.local | .env.local` files.
212+
213+
The `stop` operation is the most critical function of the script, as it ensures a clean shutdown
214+
of the database container before stopping the entire stack.
215+
216+
This script is useful if you are using the database container within the stack.
217+
218+
see more here ![stack Management](doc/infra/compose/stack_management.md)
219+
200220
### Using a env.local method for custom .env values
201221

202222
It may be easier to deal with a local file to manage our env variables.
@@ -411,8 +431,3 @@ You can also download a testing pre installed Virtual Machine in OVA format here
411431

412432
https://www.phraseanet.com/download/
413433

414-
415-
416-
417-
418-
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
Certainly! Here's a README for the script that provides an overview of its functionality, usage, and features:
2+
3+
---
4+
5+
# Docker Stack Management Script
6+
7+
This script is an helper designed to manage a Phraseanet Docker compose stack by wrapping docker compose commande. It provides functionalities to start, stop, check, and gather information about the Docker stack, including docker and Phraseanet version checks, log viewing, and environment details.
8+
9+
## Features
10+
11+
- **Start and Stop the Docker Stack**: Easily start or stop your Docker stack with simple commands.
12+
- **Version Checking**: Verify the compatibility of Docker and Docker Compose versions.
13+
- **Environment Information**: Gather detailed information about the environment, including Phraseanet installation status, version details, and internal URLs.
14+
- **Log Viewing**: View logs for all containers or filter logs for a specific container.
15+
- **Environment Variables**: Load and display environment variables from `.env` and either `env.local` or `.env.local` files.
16+
17+
## Usage
18+
19+
### Prerequisites
20+
21+
- Docker and Docker Compose installed on your system.
22+
- Appropriate permissions to execute Docker commands.
23+
- Environment files (`.env`, `env.local`, or `.env.local`) configured with necessary variables.
24+
25+
### Commands
26+
27+
- **Start the Stack**:
28+
```bash
29+
./manage_docker.sh start
30+
```
31+
32+
- **Stop the Stack**:
33+
```bash
34+
./manage_docker.sh stop
35+
```
36+
37+
- **Check Versions**:
38+
```bash
39+
./manage_docker.sh check
40+
```
41+
42+
- **Display Environment Information**:
43+
```bash
44+
./manage_docker.sh info
45+
```
46+
47+
- **View Logs**:
48+
- For all containers:
49+
```bash
50+
./manage_docker.sh log
51+
```
52+
- For a specific container:
53+
```bash
54+
./manage_docker.sh log <container_name>
55+
```
56+
57+
### Environment Variables
58+
59+
The script uses the following environment variables, which should be defined in your environment files:
60+
61+
- `PHRASEANET_DOCKER_TAG`: The Docker tag for the Phraseanet image.
62+
- `PHRASEANET_DOCKER_REGISTRY`: The Docker registry for the Phraseanet image.
63+
- `PHRASEANET_HOSTNAME`: The hostname for the Phraseanet instance.
64+
- `PHRASEANET_SCHEME`: The scheme (e.g., `http` or `https`) for the Phraseanet instance.
65+
- `PHRASEANET_APP_PORT`: The port for the Phraseanet application.
66+
67+
### Notes
68+
69+
- Ensure that the environment files (`.env`, `env.local`, or `.env.local`) are correctly configured with the necessary variables.
70+
- The script checks for the presence of `config/configuration.yml` to determine if Phraseanet is installed.
71+
- The script constructs the internal URL of the Phraseanet instance using the environment variables `PHRASEANET_HOSTNAME`, `PHRASEANET_SCHEME`, and `PHRASEANET_APP_PORT`.
72+

docker-compose.altenatives.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: "3.9"
2-
31
services:
42

53
db:

docker-compose.datastores.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: "3.9"
2-
31
services:
42
db:
53
image: $PHRASEANET_DOCKER_REGISTRY/phraseanet-db:$PHRASEANET_DOCKER_TAG

docker-compose.limits.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: "3.9"
2-
31
services:
42
gateway:
53
deploy:

docker-compose.override.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
version: "3.9"
21
services:
32
gateway:
43
volumes:

docker-compose.tools.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: "3.9"
2-
31
services:
42
mailhog:
53
image: mailhog/mailhog

docker-compose.under-phrasea.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: "3.9"
2-
31
networks:
42
phrasea:
53
name: ${PHRASEA_NETWORK_NAME}

docker-compose.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: "3.9"
2-
31
networks:
42
internal:
53
ipam:
@@ -285,6 +283,14 @@ services:
285283
- PHRASEANET_SESSION_PORT
286284
- PHRASEANET_USER_SESSION_IDLE
287285
- PHRASEANET_USER_SESSION_LIFETIME
286+
- IMAGEMAGICK_POLICY_VERSION
287+
- IMAGEMAGICK_POLICY_WIDTH
288+
- IMAGEMAGICK_POLICY_HEIGHT
289+
- IMAGEMAGICK_POLICY_MAP
290+
- IMAGEMAGICK_POLICY_MEMORY
291+
- IMAGEMAGICK_POLICY_AREA
292+
- IMAGEMAGICK_POLICY_DISK
293+
- IMAGEMAGICK_POLICY_TEMPORARY_PATH
288294
volumes:
289295
- ${PHRASEANET_CONFIG_DIR}:/var/alchemy/Phraseanet/config:rw
290296
- ${PHRASEANET_LOGS_DIR}:/var/alchemy/Phraseanet/logs:rw

0 commit comments

Comments
 (0)