Skip to content

Commit

Permalink
Merge pull request #53 from lopes-vincent/docker
Browse files Browse the repository at this point in the history
Add docker + other various fixes
  • Loading branch information
lopes-vincent authored Apr 1, 2020
2 parents b50498d + b117f4e commit c84fb6f
Show file tree
Hide file tree
Showing 8 changed files with 213 additions and 77 deletions.
Empty file added .docker/mysql-data/.gitkeep
Empty file.
55 changes: 55 additions & 0 deletions .docker/nginx/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
server {
listen 80;

root /application/web/;
index index.php;

access_log /var/log/nginx/starter.tld_access.log;
error_log /var/log/nginx/starter.tld_error.log;


location / {
try_files $uri $uri/ @rewriteapp;
}

location @rewriteapp {
# rewrite all to index.php
rewrite ^(.*)$ /index.php/$1 last;
}

# Php configuration
location ~ ^/(index|index_dev)\.php(/|$) {
# Php-FPM Config (Socks or Network)
#fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
fastcgi_pass php-fpm:9000;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_read_timeout 3000;
}

# Security. discard all files and folders starting with a "."
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}
# Stuffs
location = /favicon.ico {
allow all;
access_log off;
log_not_found off;
}
location ~ /robots.txt {
allow all;
access_log off;
log_not_found off;
}

# Static files
location ~* ^.+\.(jpg|jpeg|gif|css|png|js|pdf|zip)$ {
expires 30d;
access_log off;
log_not_found off;
}
}
19 changes: 19 additions & 0 deletions .docker/php-fpm/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM phpdockerio/php73-fpm:latest
WORKDIR "/application"

# Fix debconf warnings upon build
ARG DEBIAN_FRONTEND=noninteractive

# Install selected extensions and other stuff
RUN apt-get update \
&& apt-get -y --no-install-recommends install php7.3-mysql php7.3-gd php-imagick php7.3-intl php-xdebug \
&& apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*

# Install git
RUN apt-get update \
&& apt-get -y install git \
&& apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*

RUN apt-get update \
&& apt-get -y install vim \
&& apt-get clean;
14 changes: 14 additions & 0 deletions .docker/php-fpm/php-ini-overrides.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
upload_max_filesize = 100M
post_max_size = 108M
html_errors=On
display_errors=On
date.timezone=Europe/Paris
max_execution_time = 80

xdebug.remote_enable=1
xdebug.remote_autostart=0
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.profiler_enable=0
xdebug.profiler_enable_trigger=1
xdebug.profiler_output_dir="/application/log"
28 changes: 4 additions & 24 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
!/cache/.gitkeep
!/log/.gitkeep
!/cache/.htaccess
.docker/mysql-data/*
!.docker/mysql-data/.gitkeep

# Thelia default templates
/templates/frontOffice/default
Expand All @@ -20,29 +22,7 @@
/local/media
/local/session

# Thelia default modules
/local/modules/Cheque
/local/modules/Carousel
/local/modules/HookCurrency
/local/modules/HookProductsNew
/local/modules/Tinymce
/local/modules/Colissimo
/local/modules/HookCustomer
/local/modules/HookProductsOffer
/local/modules/VirtualProductControl
/local/modules/Front
/local/modules/HookLang
/local/modules/HookSearch
/local/modules/VirtualProductDelivery
/local/modules/HookAnalytics
/local/modules/HookLinks
/local/modules/HookSocial
/local/modules/HookCart
/local/modules/HookNavigation
/local/modules/TheliaDebugBar
/local/modules/HookContact
/local/modules/HookNewsletter
/local/modules/TheliaSmarty
/local/modules/FreeOrder
# Thelia modules
/local/modules/*

### Please add your dependancies here
129 changes: 80 additions & 49 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,85 @@ Requirements
* Web Server Apache 2 or Nginx
* MySQL 5

## Create a Thelia project

``` bash
$ curl -sS https://getcomposer.org/installer | php
$ php composer.phar create-project thelia/thelia-project path/ 2.3.2 (or 2.2.4)
```

## Install it with your own environment

You can install Thelia using the cli tool and the scripts provided by thelia/setup

``` bash
$ php Thelia thelia:install
```

Consult the page : http://localhost/thelia/web/index_dev.php

You can create a virtual host and choose web folder for root directory.

## Quick install with docker-compose

`Docker` and `docker-compose` have to be installed.

Build your docker containers on detached mode
``` bash
$ docker-compose up -d
```

Install thelia
``` bash
$ php Thelia thelia:install
```
By default if you haven't changed the `docker-compose.yml` you'll have to answer these questions like this

```
Database host [default: localhost] : mariadb
```
```
Database port [default: 3306] : 3306
```
```
Database name (if database does not exist, Thelia will try to create it) : thelia
```

```
Database username : thelia
```

```
Database pasword : thelia
```

Next just go to http://localhost:8080 and you should see your Thelia installed !

If you want add some sample data just execute this command (still in your container)
``` bash
$ php local/setup/import.php
```

If you want to access your database from your computer (with DBeaver, Sequel Pro or anything else) the host is `localhost` and the port is `8086`

Documentation
-------------

Thelia documentation is available at http://doc.thelia.net

Roadmap
-------

The Roadmap is available at http://thelia.net/community/roadmap


Contribute
----------

See the documentation : http://doc.thelia.net/en/documentation/contribute.html

### Mac OSX

If you use Mac OSX, it still doesn't use php 5.4 as default php version... There are many solutions for you :

* use [phpbrew](https://github.com/c9s/phpbrew)
Expand Down Expand Up @@ -81,52 +160,4 @@ phar.readonly = Off

For tar.bz2 archives, you need tar's dependencies and the extension "bzip2". See [PHP Doc](http://php.net/manual/fr/book.bzip2.php)

For tar.gz archives, you need tar's dependencies and the extension "zlib". See [PHP Doc](http://fr2.php.net/manual/fr/book.zlib.php)

## Create a Thelia project

``` bash
$ curl -sS https://getcomposer.org/installer | php
$ php composer.phar create-project thelia/thelia-project path/ 2.4.0 (or 2.3.5)
```

## Install it

You can install Thelia using the cli tool and the scripts provided by thelia/setup

### Using cli tools

``` bash
$ php Thelia thelia:install
```

You just have to follow all instructions.

Documentation
-------------

Thelia documentation is available at http://doc.thelia.net

The documentation is also in beta version and some part can be obsolete cause to some refactor.


Roadmap
-------

The Roadmap is available at http://thelia.net/community/roadmap


Contribute
----------

see the documentation : http://doc.thelia.net/en/documentation/contribute.html

Usage
-----

Consult the page : http://localhost/thelia/web/index_dev.php

You can create a virtual host and choose web folder for root directory.

We still have lot of work to achieve but enjoy this part.

For tar.gz archives, you need tar's dependencies and the extension "zlib". See [PHP Doc](http://fr2.php.net/manual/fr/book.zlib.php)
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
"thelia/hook-customer-module": "2.4.0",
"thelia/hook-products-offer-module": "2.4.0",
"thelia/hook-newsletter-module": "2.4.0",
"thelia/carousel-module": "dev-master",
"thelia/free-order-module": "dev-master",
"thelia/thelia-migrate-country-module": "dev-master",
"thelia/hook-admin-home-module": "dev-master"
"thelia/carousel-module": "2.4.0",
"thelia/free-order-module": "2.4.0",
"thelia/thelia-migrate-country-module": "2.4.0",
"thelia/hook-admin-home-module": "2.4.0"
},
"minimum-stability": "dev",
"prefer-stable": true,
Expand Down
37 changes: 37 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
version: "3.1"

services:

mariadb:
image: mariadb:10.1
container_name: thelia-mariadb
working_dir: /application
volumes:
- .:/application
- .docker/mysql-data:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=thelia
- MYSQL_USER=thelia
- MYSQL_PASSWORD=thelia
ports:
- "8086:3306"

webserver:
image: nginx:alpine
container_name: thelia-webserver
working_dir: /application
volumes:
- .:/application
- .docker/nginx/nginx.conf:/etc/nginx/conf.d/default.conf
ports:
- "8080:80"

php-fpm:
build: .docker/php-fpm
container_name: thelia-php-fpm
working_dir: /application
volumes:
- .:/application
- .docker/php-fpm/php-ini-overrides.ini:/etc/php/7.3/fpm/conf.d/99-overrides.ini
- .docker/php-fpm/php-ini-overrides.ini:/etc/php/7.3/cli/conf.d/99-overrides.ini

0 comments on commit c84fb6f

Please sign in to comment.