Base template for EC and similar websites. Template based on Laravel framework and set up to run on AWS ESC. For local development it needs Docker, Docker Compose and Make. The project can be deployed from local machine or via GitLab. The infrastructure of this project can be created with related project on GitHub
- An AWS account with created infrastructure
- Docker
- Docker Compose
- Make
- sed
- GitLab account (deploy via GitLab)
- macOS or Linux
- php 8.0.3-fpm based on alpine 3.13
- nginx 1.19.4 based on alpine latest
- xdebug 3.0.4 (local development only)
- Laravel 8.x
- UIkit 3.6.x
- VueJS 2.6.x
- Email catcher MailDev (local development only)
- AWS CLI v2 in docker container
- Xdebug mode
develop,debug,trace,profile
. - Xdebug profiler output
./storage/xdebug
. - Xdebug profiler output name
cachegrind.%t
. - Xdebug start_with_request
trigger
. You can use Xdebug helper for Chrome. - Xdebug client_host passes from
RHOST
variable in Makefile.
- Build a docker image with the following commands
make build
- Run the project
make up
- Run the migration script
make migrate
- Access to
http://localhost:9010
to watch web pages - Access to
http://localhost:9010/admin/login
to login to Admin's pages - Access to
http://localhost:9010/partner/login
to login to Partner's pages - Run Yarn watch script
make watch
- In
./Makefile
replaceAWS_PROFILE
AWS_REGION_NAME
AWS_ACCOUNT_ID
CLUSTER_NAME
PROJECT_NAME
with yours. - On AWS create a new policy
AWSClusterDeployPolicy
with content from./aws/AWSClusterDeployPolicy.json
- Create a new user
MyECSDeployUser
. Attach two policiesAmazonEC2ContainerRegistryFullAccess
and policy from step 2 to the user. Save your credentials. - Run
make aws-setup
and set up your awscli. (access key, region etc.) - In
.aws/run-task-migrate.json
replacesecurityGroups
andsubnets
to yours. Commit these changes. (migrate the app on AWS Fargate)
Run make deploy-prod-
. At first, it will migrate your database in ECS Fargate then run the deployment.
- Checkout a commit to roll back.
- Run
make rollback-db-prod
[IN PROGRESS]
Coming soon... (see .gitlab-ci.yml)