-
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.
- Loading branch information
1 parent
38072fa
commit d9c5e14
Showing
3 changed files
with
32 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,11 @@ | ||
# PHP_2023 | ||
## Getting Started | ||
|
||
https://otus.ru/lessons/razrabotchik-php/?utm_source=github&utm_medium=free&utm_campaign=otus | ||
To launch the project, simply run the following command in your terminal: | ||
|
||
```bash | ||
sh script.sh | ||
``` | ||
|
||
This command will set up the environment, including the necessary containers, and execute any initial setup scripts. Once the setup is complete, the project will be accessible through the hostname `application.local`. | ||
|
||
Ensure your system's hosts file is configured to redirect `application.local` to the appropriate IP address, typically `127.0.0.1` for local development environments. |
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 @@ | ||
#!/bin/bash | ||
|
||
if [ ! -f .env ]; then | ||
echo "Creating .env from .env.example..." | ||
cp .env.example .env | ||
else | ||
echo ".env already exists." | ||
fi | ||
|
||
echo "Launching containers..." | ||
docker-compose up -d | ||
docker-compose logs -f & | ||
|
||
echo "Installing Composer Dependencies..." | ||
docker exec -it $(docker ps -qf "name=myapp_php") sh -c "composer install" | ||
|
||
docker cp script.sql postgresql:/script.sql | ||
|
||
docker exec -it postgresql psql -U ${POSTGRES_USER} -d ${POSTGRES_DB} -f /script.sql | ||
|
||
echo -e "\033[0;32mThe project went up successfully!\033[0m" |
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