Skip to content

Commit 41122af

Browse files
committed
dockerize
1 parent 9b7ae76 commit 41122af

File tree

13 files changed

+2054
-56
lines changed

13 files changed

+2054
-56
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ composer.lock
2929

3030
###> symfony/webpack-encore-bundle ###
3131
/node_modules/
32-
/public/build/
3332
/public/ckeditor4/
3433
npm-debug.log
3534
###< symfony/webpack-encore-bundle ###

README.md

Lines changed: 24 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -16,77 +16,46 @@
1616
<br/><br/>
1717
</p>
1818

19-
# Install with Docker Compose
19+
# Installation
2020

21-
### Technical requirements
22-
- [docker-compose](https://docs.docker.com/compose/install/)
23-
24-
### Installation
21+
### Requirements
22+
- [docker compose](https://docs.docker.com/compose/install/)
2523

2624
```bash
2725
# Clone repository
2826
git clone [email protected]:acantepie/umbrella-admin-demo.git umbrella_demo
2927
cd umbrella_demo
3028

31-
# Build / Up Docker
32-
docker-compose up -d
33-
```
29+
# up docker
30+
docker compose up -d
3431

35-
Open a docker shell :
36-
```bash
37-
docker-compose exec symfony bash
38-
```
32+
# install php dependency
33+
docker compose exec web composer install
3934

40-
All commands below must be executed on *Docker Shell* :
41-
```bash
42-
# Install / build dependencies
43-
composer install
44-
yarn install
45-
yarn build
46-
yarn copy-ckeditor
35+
# create database
36+
docker compose exec web bin/console doctrine:database:create
37+
docker compose exec web bin/console doctrine:schema:update --force
4738

48-
# Prepare database
49-
php bin/console doctrine:schema:create
50-
php bin/console doctrine:fixtures:load --no-interaction
39+
# load fixtures
40+
docker compose exec web bin/console doctrine:load:fixtures -n
5141
```
5242

53-
App url : http://127.0.0.1:8080/
54-
55-
# Install locally
43+
App url : http://localhost
5644

57-
### Technical requirements
58-
- PHP 8.2 or higher
59-
- PHP extensions: `json`, `mbstring`, `xml`
60-
- [composer](https://getcomposer.org/)
61-
- [Symfony requirements](https://symfony.com/doc/current/setup.html#technical-requirements)
62-
- [Node.js](https://nodejs.org/en/download/)
63-
- [yarn](https://yarnpkg.com/getting-started/install)
45+
# Build assets
6446

65-
### Installation
47+
### Requirements
48+
- node 20 or higher
49+
- yarn
6650

6751
```bash
68-
# Clone repository
69-
git clone [email protected]:acantepie/umbrella-admin-demo.git umbrella_demo
70-
cd umbrella-demo
71-
```
72-
73-
You must edit the `DATABASE_URL` env var in the `.env` file to use your database credentials.
74-
75-
```bash
76-
# Install / build dependencies
77-
composer install
52+
# install assets
7853
yarn install
79-
yarn build
80-
yarn copy-ckeditor
8154

82-
# Prepare database
83-
php bin/console doctrine:database:create
84-
php bin/console doctrine:schema:create
85-
php bin/console doctrine:fixtures:load --no-interaction
86-
```
55+
# build assets in prod mode
56+
yarn build
8757

88-
Serve:
89-
```bash
90-
php -S localhost:8000 -t public/
91-
```
92-
App url : http://127.0.0.1:8000/
58+
# install ckeditor
59+
cp -R node_modules/ckeditor4 public
60+
# or yarn copy-ckeditor
61+
```

compose.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
services:
2+
web:
3+
build:
4+
context: ./docker/web
5+
environment:
6+
DATABASE_URL: "postgresql://app:pwd@database:5432/app?serverVersion=16&charset=utf8"
7+
ports:
8+
- "80:80"
9+
- "443:443/tcp"
10+
- "443:443/udp"
11+
volumes:
12+
- .:/app
13+
- ./docker/web/php.ini:/usr/local/etc/php/php.ini:ro
14+
- caddy_data:/data
15+
- caddy_config:/config
16+
database:
17+
image: postgres:16-alpine
18+
environment:
19+
POSTGRES_DB: app
20+
POSTGRES_USER: app
21+
POSTGRES_PASSWORD: pwd
22+
volumes:
23+
- database_data:/var/lib/postgresql/data:rw
24+
volumes:
25+
caddy_data:
26+
caddy_config:
27+
database_data:

docker/web/Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM dunglas/frankenphp:1.4.2-php8.3-bookworm
2+
3+
RUN install-php-extensions \
4+
@composer \
5+
apcu \
6+
intl \
7+
opcache \
8+
zip \
9+
pgsql

0 commit comments

Comments
 (0)