|
3 | 3 | This is a landing page for the [PHP Revival](https://github.com/php-revival/php-revival) browser extension. |
4 | 4 |
|
5 | 5 | ## Development |
6 | | -### Without Docker |
7 | | -You'll need to have Node and NPM installed on your machine to run it locally. |
8 | | - |
| 6 | +### NPM Commands |
| 7 | +All the available NPM command you can find in [package.json](package.json) file. |
9 | 8 | #### Install Dependencies |
10 | 9 | ```bash |
11 | 10 | npm i |
12 | | -# or |
13 | | -yarn |
14 | 11 | ``` |
15 | 12 |
|
16 | 13 | #### Watch File Changes |
17 | 14 | ```bash |
18 | 15 | npm run dev |
19 | | -# or |
20 | | -yarn dev |
21 | 16 | ``` |
22 | 17 |
|
23 | 18 | Navigate to `http://localhost:3000` to see your documentation. |
24 | 19 |
|
25 | | -### With Docker |
26 | | -#### Build an image |
27 | | -To build an image, navigate to the root of the project that contains `Dockerfile` and run this command: |
| 20 | +### With Container Engine |
| 21 | +If you use a container engine like [🦦 Podman](https://podman.io/) or [🐳 Docker](https://app.docker.com/), here are the steps that you can make: |
| 22 | + |
| 23 | +#### Build an Image |
| 24 | +To build an image, navigate to the root of the project and run this Docker command: |
28 | 25 | ```bash |
29 | 26 | docker compose build |
30 | 27 | ``` |
| 28 | +For Podman, run this: |
| 29 | +```bash |
| 30 | +podman-compose build |
| 31 | +``` |
| 32 | + |
| 33 | +#### Copy `node_modules` Locally |
| 34 | +If you need to copy `node_modules` directory from the container to your local machine, run this command for Docker: |
| 35 | +```bash |
| 36 | +docker cp php-revival-landing:/app/node_modules . |
| 37 | +``` |
| 38 | +For Podman, run this: |
| 39 | +```bash |
| 40 | +podman cp php-revival-landing:/app/node_modules . |
| 41 | +``` |
| 42 | + |
| 43 | +> [!NOTE] |
| 44 | +> `node_modules` is excluded from using volume, that's why you need to copy it manually in [docker-compose.yml](docker-compose.yml) file. It's done to prevent your local modules to be copied to Linux container, since it can create incompatibility issues between operating systems if you don't use Linux. |
31 | 45 |
|
32 | | -#### Run the container |
33 | | -To run a container, navigate to the root of the project that contains `Dockerfile` and run this command: |
| 46 | +#### Run the Container |
| 47 | +To run a container, navigate to the root of the project and run this Docker command: |
34 | 48 | ```bash |
35 | 49 | docker compose up -d |
36 | 50 | ``` |
| 51 | +For Podman, run this: |
| 52 | +```bash |
| 53 | +podman-compose up -d |
| 54 | +``` |
37 | 55 |
|
38 | 56 | You can visit `http://localhost:3000` to see your documentation. |
39 | 57 |
|
40 | | -#### Enter the container |
41 | | -To enter inside of the container, run this command: |
| 58 | +#### Enter the Container |
| 59 | +To enter inside of the container, run this Docker command: |
42 | 60 | ```bash |
43 | | -docker exec -it php-revival-landing sh |
| 61 | +docker compose exec app sh |
| 62 | +``` |
| 63 | +For Podman, run this: |
| 64 | +```bash |
| 65 | +podman-compose exec app sh |
44 | 66 | ``` |
45 | 67 |
|
46 | 68 | You'll be able to run NPM commands inside of the container. |
47 | 69 |
|
48 | | -#### Stop the container |
| 70 | +#### Remove the Container |
| 71 | +To stop and remove the container, run this Docker command: |
49 | 72 | ```bash |
50 | 73 | docker compose down |
51 | 74 | ``` |
| 75 | +For Podman, run this: |
| 76 | +```bash |
| 77 | +podman-compose down |
| 78 | +``` |
0 commit comments