-
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.
Merge pull request #27 from froozeify/pos
Point de vente
- Loading branch information
Showing
67 changed files
with
2,556 additions
and
151 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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Loading the fixture | ||
Various commands are available: | ||
|
||
- `composer reload-fixture` | ||
- Empty the database then load all the fixtures | ||
- `composer reload-db` | ||
- Completely drop the database and recreate it from scratch, then load all fixtures | ||
|
||
# Creating new entity | ||
When creating a new entity, you should do the next steps : | ||
|
||
1. Create the Entity (and his linked repository) | ||
- `bin/console make:entity` | ||
2. Add the route in `config/packages/security.yaml` | ||
3. Generate the doctrine migration script | ||
- `bin/console make:migration` | ||
4. Create the matching factory (useful for generating fake data) | ||
- `bin/console make:factory` | ||
5. Optional, Create the matching story | ||
- `bin/console make:story` | ||
6. Add the data generation inside `src/DataFixtures/AppFixtures` |
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
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,4 +1,3 @@ | ||
variables_order = EGPCS | ||
expose_php = 0 | ||
date.timezone = UTC | ||
apc.enable_cli = 1 | ||
|
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
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,29 @@ | ||
# Using Alpine Linux Instead of Debian | ||
|
||
By default, Symfony Docker uses Debian-based FrankenPHP Docker images. | ||
This is the recommended solution. | ||
|
||
Alternatively, it's possible to use Alpine-based images, which are smaller but | ||
are known to be slower, and have several known issues. | ||
|
||
To switch to Alpine-based images, apply the following changes to the `Dockerfile`: | ||
|
||
```patch | ||
-FROM dunglas/frankenphp:1-php8.3 AS frankenphp_upstream | ||
+FROM dunglas/frankenphp:1-php8.3-alpine AS frankenphp_upstream | ||
|
||
-# hadolint ignore=DL3008 | ||
-RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
- acl \ | ||
- file \ | ||
- gettext \ | ||
- git \ | ||
- && rm -rf /var/lib/apt/lists/* | ||
+# hadolint ignore=DL3018 | ||
+RUN apk add --no-cache \ | ||
+ acl \ | ||
+ file \ | ||
+ gettext \ | ||
+ git \ | ||
+ ; | ||
``` |
This file was deleted.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -0,0 +1,83 @@ | ||
# Using MySQL | ||
|
||
The Docker configuration of this repository is extensible thanks to Flex recipes. By default, the recipe installs PostgreSQL. | ||
If you prefer to work with MySQL, follow these steps: | ||
|
||
First, install the `symfony/orm-pack` package as described: `docker compose exec php composer req symfony/orm-pack` | ||
|
||
## Docker Configuration | ||
Change the database image to use MySQL instead of PostgreSQL in `compose.yaml`: | ||
|
||
```diff | ||
###> doctrine/doctrine-bundle ### | ||
- image: postgres:${POSTGRES_VERSION:-15}-alpine | ||
+ image: mysql:${MYSQL_VERSION:-8} | ||
environment: | ||
- POSTGRES_DB: ${POSTGRES_DB:-app} | ||
+ MYSQL_DATABASE: ${MYSQL_DATABASE:-app} | ||
# You should definitely change the password in production | ||
+ MYSQL_RANDOM_ROOT_PASSWORD: "true" | ||
- POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-!ChangeMe!} | ||
+ MYSQL_PASSWORD: ${MYSQL_PASSWORD:-!ChangeMe!} | ||
- POSTGRES_USER: ${POSTGRES_USER:-app} | ||
+ MYSQL_USER: ${MYSQL_USER:-app} | ||
healthcheck: | ||
- test: ["CMD", "pg_isready", "-d", "${POSTGRES_DB:-app}", "-U", "${POSTGRES_USER:-app}"] | ||
+ test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"] | ||
timeout: 5s | ||
retries: 5 | ||
start_period: 60s | ||
volumes: | ||
- - database_data:/var/lib/postgresql/data:rw | ||
+ - database_data:/var/lib/mysql:rw | ||
# You may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data! | ||
- # - ./docker/db/data:/var/lib/postgresql/data:rw | ||
+ # - ./docker/db/data:/var/lib/mysql:rw | ||
###< doctrine/doctrine-bundle ### | ||
``` | ||
|
||
Depending on the database configuration, modify the environment in the same file at `services.php.environment.DATABASE_URL` | ||
``` | ||
DATABASE_URL: mysql://${MYSQL_USER:-app}:${MYSQL_PASSWORD:-!ChangeMe!}@database:3306/${MYSQL_DATABASE:-app}?serverVersion=${MYSQL_VERSION:-8}&charset=${MYSQL_CHARSET:-utf8mb4} | ||
``` | ||
|
||
Since we changed the port, we also have to define this in the `compose.override.yaml`: | ||
```diff | ||
###> doctrine/doctrine-bundle ### | ||
database: | ||
ports: | ||
- - "5432" | ||
+ - "3306" | ||
###< doctrine/doctrine-bundle ### | ||
``` | ||
|
||
Last but not least, we need to install the MySQL driver in `Dockerfile`: | ||
```diff | ||
###> doctrine/doctrine-bundle ### | ||
-RUN install-php-extensions pdo_pgsql | ||
+RUN install-php-extensions pdo_mysql | ||
###< doctrine/doctrine-bundle ### | ||
``` | ||
|
||
## Change Environment | ||
Change the database configuration in `.env`: | ||
|
||
```dotenv | ||
DATABASE_URL=mysql://${MYSQL_USER:-app}:${MYSQL_PASSWORD:-!ChangeMe!}@database:3306/${MYSQL_DATABASE:-app}?serverVersion=${MYSQL_VERSION:-8}&charset=${MYSQL_CHARSET:-utf8mb4} | ||
``` | ||
|
||
## Final steps | ||
Rebuild the docker environment: | ||
```shell | ||
docker compose down --remove-orphans && docker compose build --pull --no-cache | ||
``` | ||
|
||
Start the services: | ||
```shell | ||
docker compose up -d | ||
``` | ||
|
||
Test your setup: | ||
```shell | ||
docker compose exec php bin/console dbal:run-sql -q "SELECT 1" && echo "OK" || echo "Connection is not working" | ||
``` |
Oops, something went wrong.