Skip to content

Chore/pimcore template #28

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# PhpStorm / IDEA
.idea
# NetBeans
nbproject
# VS Code
.prettierrc.js
1 change: 1 addition & 0 deletions templates/pimcore-php8.0/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PROJECT_DOCUMENT_ROOT=public
23 changes: 23 additions & 0 deletions templates/pimcore-php8.0/.env.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Port configuration
MAILHOG_PORT=8025
WEB_PORT_HTTP=80
WEB_PORT_HTTPS=443

# Database
DB_HOST=db
DB_USER=pimcore
DB_PASS=pimcore
DB_NAME=pimcore
MYSQL_ROOT_PASSWORD=pimcore
MYSQL_PORT=3306

# Elasticsearch
ELASTICSEARCH_HOST=elasticsearch
ELASTICSEARCH_PORT_REST=9200
ELASTICSEARCH_PORT_NODE_COMM=9300

# xDebug configuration
XDEBUG_CONFIG="remote_host=${HOST_IP} coverage_enable=0 remote_enable=1 remote_connect_back=1"
COMPOSER_ALLOW_XDEBUG=0

ES_JAVA_OPTS="-Xms512m -Xmx512m"
88 changes: 88 additions & 0 deletions templates/pimcore-php8.0/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
version: '3.4'
x-custom:
type: pimcore-php8.0
version: 1.0.0
php-environment: &php-env-vars
# Database settings
DB_HOST: ~
DB_USER: ~
DB_PASS: ~
DB_NAME: ~
#General settings
PROJECT_DOCUMENT_ROOT: ~

services:
php:
image: youwe-pimcore-php:8.0-apache
working_dir: "${PWD}"
volumes:
- "${PWD}:${PWD}"
ports:
- "${WEB_PORT_HTTP}:80"
- "${WEB_PORT_HTTPS}:443"
environment:
<<: *php-env-vars
WWW_DATA_UID: "${CUID}"
WWW_DATA_GID: "${CGID}"
DOCUMENT_ROOT: "${PWD}/${PROJECT_DOCUMENT_ROOT}"
depends_on: [db]

console:
image: youwe-pimcore-console:8.0
user: "${CUID}:${CGID}"
working_dir: "${PWD}"
volumes:
- "${HOME}:${CHOME}"
- "${PWD}:${PWD}"
- "${SSH_AUTH_SOCK}:${SSH_AUTH_SOCK}"
- /etc/group:/etc/group:ro
- /etc/passwd:/etc/passwd:ro
- /etc/shadow:/etc/shadow:ro
environment:
<<: *php-env-vars
depends_on: [db]

db:
image: mysql:8.0.27
command:
[
mysqld,
--character-set-server=utf8mb4,
--collation-server=utf8mb4_unicode_520_ci,
--innodb-file-per-table=1,
]
volumes:
- db:/var/lib/mysql
environment:
MYSQL_USER: "${DB_USER}"
MYSQL_PASSWORD: "${DB_PASS}"
MYSQL_DATABASE: "${DB_NAME}"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

db_1 | 2022-01-06 16:22:16+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.27-1debian10 started.
db_1 | 2022-01-06 16:22:16+00:00 [ERROR] [Entrypoint]: Database is uninitialized and password option is not specified
db_1 | You need to specify one of the following:
db_1 | - MYSQL_ROOT_PASSWORD
db_1 | - MYSQL_ALLOW_EMPTY_PASSWORD
db_1 | - MYSQL_RANDOM_ROOT_PASSWORD

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops, removed it here as well apparently when correcting your comment #28 (comment), added it back

MYSQL_ROOT_PASSWORD: "${MYSQL_ROOT_PASSWORD}"
ports:
- "${MYSQL_PORT}:3306"

redis-alpine:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See magento template, we can use a volume here as well (so cached data remains stored)

image: redis:5.0.7
volumes:
- redis-data:/data

elasticsearch:
image: elasticsearch:7.16.1
volumes:
- elasticsearch:/usr/share/elasticsearch/data
environment:
- discovery.type=single-node
- "ES_JAVA_OPTS=${ES_JAVA_OPTS}"
ports:
- ${ELASTICSEARCH_PORT_REST}:9200
- ${ELASTICSEARCH_PORT_NODE_COMM}:9300

mail:
image: mailhog/mailhog
ports:
- ${MAILHOG_PORT}:8025

volumes:
db:
elasticsearch:
redis-data: