-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitpod.yml
71 lines (63 loc) · 2.62 KB
/
.gitpod.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
image:
file: .gitpod.Dockerfile
ports:
- name: App
port: 8000
onOpen: open-browser
visibility: public
description: Symfony Server
- name: Shop
port: 8005
onOpen: open-browser
visibility: public
description: Shop
- name: MySQL
port: 3306
onOpen: ignore
- name: Adminer
onOpen: ignore
port: 5000
tasks:
- name: App
init: |
docker run --restart always -d --name=mysql -p 127.0.0.1:3306:3306 -e MYSQL_ROOT_PASSWORD=root mysql:8
docker run --restart always -d --name=adminer --link mysql:mysql -p 5000:8080 -e ADMINER_DESIGN=pepa-linha -e ADMINER_DEFAULT_SERVER=mysql -e ADMINER_PLUGINS="tables-filter table-structure json-column version-noverify" ghcr.io/shyim/shopware-docker/adminer
docker run --restart always -d --name=shop -p 8005:80 dockware/dev:latest
sleep 30
rm .env
composer install
mysql -u root -e "create database mothership_demo_app"
cp -r .env.example .env
sed -i "s|SHOPWARE_APP_URL=|SHOPWARE_APP_URL=$(gp url 8000)|g" .env
cp -r ./app/MothershipDemoApp/manifest.xml.example ./app/MothershipDemoApp/manifest.xml
sed -i "s|SHOPWARE_APP_URL|$(gp url 8000)|g" ./app/MothershipDemoApp/manifest.xml
cp dockware.env.example dockware.env
sed -i "s|APP_URL=|APP_URL=$(gp url 8005)|g" dockware.env
docker cp $(pwd)/dockware.env shop:/var/www/html/.env
docker cp $(pwd)/app/MothershipDemoApp/. shop:/var/www/html/custom/apps/MothershipDemoApp
docker exec shop bash -c './bin/console system:install --basic-setup --drop-database --create-database -f'
docker exec shop bash -c 'APP_ENV=prod ./bin/console framework:demodata --orders 10 --products 10 --media 10 --customers 10 --promotions 5 --manufacturers 5
npm i
npm run build
command: |
# Gitpod registers the ports on first docker command
docker ps
# Wait for port open
gp ports await 3306
# Wait until MySQL is reachable
until mysqladmin ping; do
sleep 1
done
# Run DB migration
bin/console doctrine:migrations:migrate --no-interaction
# Start Webserver
symfony server:start --port 800
# Install & activate the demo app
docker exec shop bash -c './bin/console app:install MothershipDemoApp --no-validate --activate --force'
echo 'Your environment is ready to run!'
- name: Getting Started
command: |
echo 'Your environment is starting soon. You can see the progress in the terminal'
echo "App URL: $(gp url 8000)"
echo "Adminer URL: $(gp url 5000)"
echo "Shopware URL: $(gp url 8005)"