Skip to content

Commit

Permalink
Major: Refactor and first complete flow
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcbrl committed Oct 8, 2024
1 parent 6ff9675 commit a7ceb10
Show file tree
Hide file tree
Showing 28 changed files with 1,640 additions and 277 deletions.
2 changes: 1 addition & 1 deletion Dockerfile → .devops/Dockerfile
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ COPY . /api

RUN composer install

# ENTRYPOINT [ "sh", "-c", "php public/index.php" ]
ENTRYPOINT [ "sh", "-c", "php public/index.php" ]
9 changes: 9 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
# FIDELIFY API

DB_TYPE=''
DB_HOST=''
DB_PORT=''
DB_NAME=''
DB_USER=''
DB_PASS=''

JWT_SECRET=''

SERVER_HOST=''
SERVER_PORT=''
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ vendor

# project
.env
.devops/data
.data
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,17 @@

> Docker required: [how to install](https://docs.docker.com/engine/install/ubuntu/).
1. `docker build -t fidelify/phpswoole .`
2. `docker run -it -v $(pwd):/api -p 8003:8003 --rm --name fidelify-api fidelify/phpswoole php public/index.php`
#### compose way

1. `docker compose up -d`
2. `docker exec -it fidelify-api bash`
3. `vendor/bin/phinx migrate`

#### standalone way

1. `docker network create -d bridge local`
2. `docker run --rm -p 3306:3306 -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=fidelify --network local --name fidelify-db mysql:8.0.13`
3. `docker build -t fidelify/phpswoole .`
4. `docker run --rm -it -v c:/dev/fidelify-api:/api -p 8003:8003 --env-file .env --name fidelify-api fidelify/phpswoole`
5. `docker exec -it fidelify-api bash`
6. `vendor/bin/phinx migrate`
7 changes: 5 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "fidelify/api",
"license": "MIT",
"autoload": {
"psr-4": {
"Fidelify\\Api\\": "src/"
Expand All @@ -14,8 +15,10 @@
"league/container": "^4.2",
"laminas/laminas-diactoros": "^3.4",
"laminas/laminas-httphandlerrunner": "^2.10",
"ilexn/swoole-convert-psr7": "^0.6.1",
"ilexn/swoole-convert-psr7": "^0.6",
"nyholm/psr7": "^1.8",
"illuminate/validation": "^11.25"
"illuminate/validation": "^11.25",
"firebase/php-jwt": "^6.10",
"robmorgan/phinx": "^0.14"
}
}
Loading

0 comments on commit a7ceb10

Please sign in to comment.