-
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
1d4c054
commit 36cc982
Showing
6 changed files
with
56 additions
and
113 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
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,40 @@ | ||
name: Deploy demo | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
deploy-demo: | ||
name: Deploy demo | ||
runs-on: ubuntu-latest | ||
if: always() | ||
steps: | ||
- name: Deploy in EC2 | ||
env: | ||
BRANCH: ${{ format('origin/{0}', github.ref_name) }} | ||
PRIVATE_KEY: ${{ secrets.AWS_DEPLOY_KEY }} | ||
HOSTNAME : ${{ secrets.AWS_HOSTNAME }} | ||
USER_NAME : ${{ secrets.AWS_USER }} | ||
run: | | ||
echo "$PRIVATE_KEY" > private_key && chmod 600 private_key | ||
ssh -o StrictHostKeyChecking=no -i private_key ${USER_NAME}@${HOSTNAME} " | ||
cd /home/ubuntu/ && | ||
[ -d oro ] || git clone https://github.com/Elastic-Suite/oro-demo.git oro && | ||
cd /home/ubuntu/oro && | ||
[ -d src/packages/GallyPlugin ] || git clone https://github.com/Elastic-Suite/gally-oro-connector.git src/packages/GallyPlugin && | ||
docker system prune -af && | ||
([[ $(docker volume ls -q | awk '!/_/' | wc -l) -eq 0 ]] || docker volume rm $(docker volume ls -q | awk '!/_/' | tr '\n' ' ')) && | ||
docker compose down && | ||
git fetch --all && git reset --hard && git checkout ${{ env.BRANCH }} && | ||
cd /home/ubuntu/oro/src/packages/GallyPlugin && | ||
git fetch --all && git reset --hard && git checkout ${{ env.BRANCH }} && | ||
cd /home/ubuntu/oro && | ||
docker compose -f compose.yml run --rm php-fpm-app bash -c "source ~/.bashrc; composer install" && | ||
mkdir -p src/public/media && | ||
sudo chown ubuntu:ubuntu -R src && | ||
docker compose -f compose.yml up install && | ||
docker compose -f compose.yml up -d --build && | ||
docker compose exec php-fpm-app composer repositories.gally-connector '{ "type": "path", "url": "./packages/GallyPlugin", "options": { "versions": { "gally/oro-plugin": "2.0.0"}} }' && | ||
docker compose exec php-fpm-app composer require gally/oro-plugin:2.0.0 && | ||
docker compose exec php-fpm-app bin/console cache:clear | ||
" |
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 |
---|---|---|
|
@@ -32,6 +32,11 @@ bin/php-cs-fixer fix --diff packages/GallyPlugin/ | |
bin/phpstan --memory-limit=1G analyse -c packages/GallyPlugin/phpstan.neon | ||
bin/phpunit --config phpunit.xml.dist packages/GallyPlugin/ --stop-on-fail | ||
``` | ||
Create/edit js files | ||
```shell | ||
docker compose exec php-fpm-app bin/console oro:assets:install --relative-symlink # Only required once on js creation | ||
docker compose exec php-fpm-app bin/console oro:assets:build --watch | ||
``` | ||
|
||
## How this env was build | ||
|
||
|
@@ -50,108 +55,3 @@ mv oro src | |
# Add user id / group id in .env | ||
``` | ||
|
||
## Prerequisites | ||
|
||
Install [Docker](https://docs.docker.com/engine/install/) with [Docker Compose](https://docs.docker.com/compose/install/). | ||
|
||
**Note:** The application uses port 80, so make sure that other services do not use it. | ||
|
||
## Run Application | ||
|
||
#### 1. Download Repository With Docker Compose Configuration File | ||
|
||
Check out the git repository: | ||
```bash | ||
git clone https://github.com/oroinc/docker-demo.git | ||
cd docker-demo | ||
``` | ||
Or download the archive file and extract it: | ||
```bash | ||
wget https://github.com/oroinc/docker-demo/archive/master.tar.gz -O - | tar -xzf - | ||
cd docker-demo | ||
``` | ||
|
||
#### 2. Run Application Containers | ||
|
||
The configuration is entirely predefined, and you can only change the domain name where the application will be located. By default, it is `oro.demo`. If you need to change the domain, edit the `.env` file and change `ORO_APP_DOMAIN=my-custom-domain.demo`. | ||
|
||
Run init service: | ||
```bash | ||
docker compose up restore | ||
``` | ||
|
||
Alternatively, you can install the application from scratch, but it will require more time and resources. | ||
|
||
Run install service: | ||
```bash | ||
docker compose up install | ||
``` | ||
|
||
You can run the application as soon as it is installed or initialized. | ||
|
||
Run application: | ||
```bash | ||
docker compose up application | ||
``` | ||
|
||
The docker compose will download the required images, create networks and run containers. | ||
Application [orocommerce-application](https://github.com/oroinc/orocommerce-application) is used by default. | ||
You can run other community applications, such as `crm-application`, `platform-application`, or `commerce-crm-application`. | ||
To select another application, set another image in the `.env` file, for example: | ||
```bash | ||
ORO_IMAGE=docker.io/oroinc/crm-application | ||
``` | ||
If you want to get the application in a different locale, add the contents of the file `.env-locale-de_DE` or `.env-locale-fr_FR` to `.env` and restart the restore service and application. | ||
```bash | ||
cat .env-locale-de_DE >> .env | ||
``` | ||
|
||
To track the logs from the php-fpm-app container, run `docker compose logs -f php-fpm-app`. To get the list of containers, run `docker compose ps`. | ||
|
||
#### 3. Add a Record to File `/etc/hosts` | ||
|
||
``` | ||
127.0.0.1 oro.demo | ||
``` | ||
|
||
#### 4. Open the Application in a Browser | ||
|
||
Now, you can open URL [http://oro.demo](http://oro.demo) in your browser. | ||
|
||
To access the back-office, use *admin* as both login and password. | ||
To access the storefront, use the credentials of the predefined demo user roles. To log in as a buyer, use *[email protected]* both as your login and password. To log in as a manager, use *[email protected]* both as your login and password. | ||
|
||
## Access the Mail Catcher | ||
|
||
[Smtp service](https://github.com/mailhog/MailHog) is additionally launched so that you can send emails from the application. It receives all mail and has a web interface that enables you to view it and perform the required actions. The web interface for the mail catcher is available at the address [http://oro.demo/mailcatcher](http://oro.demo/mailcatcher). | ||
|
||
## Stop the Application | ||
|
||
- To stop and remove all containers, run `docker compose down`. | ||
|
||
- To stop and remove all containers with the data saved in volumes, run `docker compose down -v`. | ||
|
||
## Troubleshooting | ||
|
||
- If you deployed the application before, pull fresh images with `docker compose pull`. | ||
|
||
## About this Project | ||
|
||
This repository provides a Docker Compose configuration file (compose.yaml) and demonstrates how to run different applications + required services in containers. Oro Inc. provides images with applications Community Edition in public Docker Hub. | ||
|
||
**This deployment is NOT intended for a production environment.** | ||
|
||
**Docker images with different applications:** | ||
OroCommerce Community Edition: [docker.io/oroinc/orocommerce-application](https://hub.docker.com/r/oroinc/orocommerce-application) | ||
OroCRM Community Edition: [docker.io/oroinc/crm-application](https://hub.docker.com/r/oroinc/crm-application) | ||
OroPlatform Community Edition: [docker.io/oroinc/platform-application](https://hub.docker.com/r/oroinc/platform-application) | ||
|
||
One image is used to run containers in several roles: web server, php-fpm, consumer, websocket server, and cron service. | ||
All these services must be running, and the PostgreSQL database must be prepared for a full-fledged application. | ||
|
||
License | ||
------- | ||
|
||
[MIT][1] Copyright (c) 2013 - 2023, Oro, Inc. | ||
|
||
[1]: LICENSE |
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
File renamed without changes.
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