Daniel 2 лет назад
Родитель
Сommit
82c9e2a6ed
3 измененных файлов: 12 добавлений и 49 удалений
  1. +6
    -12
      .docker/docker-compose.yml
  2. +1
    -2
      .gitignore
  3. +5
    -35
      README.md

+ 6
- 12
.docker/docker-compose.yml Просмотреть файл

@@ -3,10 +3,10 @@ name: spt-magento


services: services:
mariadb: mariadb:
image: mariadb:10.4
container_name: mariadb-10.4
image: mariadb
container_name: mariadb
ports: ports:
- "3401:3306"
- "3306:3306"
environment: environment:
# think about .env file here # think about .env file here
MYSQL_ROOT_PASSWORD: root MYSQL_ROOT_PASSWORD: root
@@ -19,8 +19,8 @@ services:
build: build:
context: . context: .
dockerfile: Dockerfile dockerfile: Dockerfile
image: 'php81_apache'
container_name: php-8.1-apache
image: 'php_apache'
container_name: php-apache
environment: environment:
- "APACHE_LOG_DIR:/src" - "APACHE_LOG_DIR:/src"
ports: ports:
@@ -33,18 +33,12 @@ services:
- default - default
depends_on: depends_on:
- mariadb - mariadb
- elasticsearch
elasticsearch:
image: docker.io/bitnami/elasticsearch:7
container_name: elasticsearch7
volumes:
- ./../.elasticsearch:/bitnami/elasticsearch/data'
phpmyadmin: phpmyadmin:
image: phpmyadmin image: phpmyadmin
container_name: phpmyadmin container_name: phpmyadmin
restart: always restart: always
ports: ports:
- "8102:80"
- "81:80"
environment: environment:
- PMA_ARBITRARY=1 - PMA_ARBITRARY=1
networks: networks:


+ 1
- 2
.gitignore Просмотреть файл

@@ -1,3 +1,2 @@
.idea .idea
.mariadb
.elasticsearch
.mariadb

+ 5
- 35
README.md Просмотреть файл

@@ -13,13 +13,13 @@
- `docker-compose down` - `docker-compose down`


# Remove image # Remove image
- `docker image rm php81_apache`
- `docker image rm php_apache`


# Stop containers, remove image and recreation of container # Stop containers, remove image and recreation of container
- `docker-compose down && docker image rm php81_apache && docker-compose up -d`
- `docker-compose down && docker image rm php_apache && docker-compose up -d`


# Get into container # Get into container
- `docker exec -it php-8.1-apache /bin/bash`
- `docker exec -it php-apache /bin/bash`




- `docker build -t magento-php .` - `docker build -t magento-php .`
@@ -44,35 +44,5 @@
4. Restart the containers using the following command: `docker-compose up -d` 4. Restart the containers using the following command: `docker-compose up -d`




# INSTALL MAGENTO via composer
- docker Container starten und in den Container wechseln
- composer install
- "bin/magento install" Befehl:
php bin/magento setup:install --base-url="http://127.0.0.1" \
--db-host="magento-mariadb" \
--db-name="magento" \
--db-user="root" \
--db-password="root" \
--admin-firstname="Admin" \
--admin-lastname="Admin" \
--admin-email="re@spawntree.de" \
--admin-user="admin" \
--admin-password="magento2test" \
--use-rewrites="1" \
--backend-frontname="admin" \
--db-prefix=mage_ \
--search-engine=elasticsearch7 \
--elasticsearch-host=elasticsearch \
--elasticsearch-port=9200

# create admin account
bin/magento admin:user:create --admin-user=admin --admin-password=admin2spt --admin-email=re@spawntree.de --admin-firstname=Admin --admin-lastname=Administrator

# mkdir for volumes
mkdir -m 775 elasticsearch_data magento_data mariadb_data
mkdir .elasticsearch .mariadb

# standard permission magento - do we use it?
find . -type d -exec chmod 0711 {} +
find . -type f -exec chmod 0644 {} +
find . -type f -name “*.php” -exec chmod 600 {} +
# Enable ssl document
https://time2hack.com/dockerize-php-app-with-apache-on-https/

Загрузка…
Отмена
Сохранить