diff --git a/app/Models/Shop/Price.php b/app/Models/Shop/Price.php deleted file mode 100644 index 8f8e6720..00000000 --- a/app/Models/Shop/Price.php +++ /dev/null @@ -1,32 +0,0 @@ -belongsTo(Article::class); - } - - public function article_family() - { - return $this->belongsTo(ArticleNature::class); - } - - public function scopeByArticle($query, $id) - { - return $query->where($this->table.'.article_id', $id); - } - - public function scopeByArticleNature($query, $id) - { - return $query->where($this->table.'.article_family_id', $id); - } -} diff --git a/app/Models/Shop/PriceGenericCategory.php b/app/Models/Shop/PriceGenericCategory.php deleted file mode 100644 index 04185a2e..00000000 --- a/app/Models/Shop/PriceGenericCategory.php +++ /dev/null @@ -1,22 +0,0 @@ -belongsTo(ArticleNature::class); - } - - public function price_generics() - { - return $this->hasMany(PriceGeneric::class, 'category_id'); - } -} diff --git a/app/Repositories/Shop/Prices.php b/app/Repositories/Shop/Prices.php deleted file mode 100644 index 3bfad6e1..00000000 --- a/app/Repositories/Shop/Prices.php +++ /dev/null @@ -1,27 +0,0 @@ - Price::byArticle($id)->notGeneric()->get()->toArray(), - 'generics' => Price::byArticle($id)->generic()->with([ - 'generic.prices', - 'generic.category', - ])->get()->toArray(), - ]; - } - - public static function getModel() - { - return Price::query(); - } -} diff --git a/docker/certbot/Dockerfile b/docker/certbot/Dockerfile new file mode 100755 index 00000000..50fcc03f --- /dev/null +++ b/docker/certbot/Dockerfile @@ -0,0 +1,10 @@ +FROM phusion/baseimage:bionic-1.0.0 + +LABEL maintainer="Ludovic CANDELLIER " + +COPY run-certbot.sh /root/certbot/run-certbot.sh + +RUN apt-get update +RUN apt-get install -y letsencrypt + +ENTRYPOINT bash -c "bash /root/certbot/run-certbot.sh && sleep infinity" diff --git a/docker/certbot/run-certbot.sh b/docker/certbot/run-certbot.sh new file mode 100755 index 00000000..5dfb557a --- /dev/null +++ b/docker/certbot/run-certbot.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +letsencrypt certonly --webroot -w /var/www/letsencrypt -d "$CN" --agree-tos --email "$EMAIL" --non-interactive --text + +cp /etc/letsencrypt/archive/"$CN"/cert1.pem /var/certs/"$CN"-cert1.pem +cp /etc/letsencrypt/archive/"$CN"/chain1.pem /var/certs/chain1.pem +cp /etc/letsencrypt/archive/"$CN"/fullchain1.pem /var/certs/fullchain1.pem +cp /etc/letsencrypt/archive/"$CN"/privkey1.pem /var/certs/"$CN"-privkey1.pem + diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 6297f551..982d955f 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -53,21 +53,6 @@ services: links: - docker-in-docker -### highcharts ########################################### - highcharts: - restart: always - build: - context: ./highcharts - args: - - PUID=${PUID} - - PGID=${PGID} - - TZ=${TIMEZONE} - tty: true - ports: - - "127.0.0.1:${HIGHCHARTS_PORT}:8080" - networks: - - backend - ### PHP-FPM ############################################## php-fpm: restart: always @@ -121,7 +106,7 @@ services: - ./php-fpm/php${PHP_VERSION}.ini:/usr/local/etc/php/php.ini - ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER}${APP_CODE_CONTAINER_FLAG} ports: - - "${PHP_FPM_XDEBUG_PORT}:9003" + - "127.0.0.1:${PHP_FPM_XDEBUG_PORT}:9003" expose: - "9000" extra_hosts: @@ -243,7 +228,7 @@ services: - ${DATA_PATH_HOST}/mysql-slave1:/var/lib/mysql - ${MYSQL_ENTRYPOINT_INITDB}:/docker-entrypoint-initdb.d ports: - - "127.0.0.1:3307:3306" + - "3306:3306" networks: - backend @@ -388,9 +373,11 @@ services: # - MEILI_LOG_LEVEL # - MEILI_DB_PATH=${MEILI_DB_PATH:-/data.ms} ports: - - ${MEILI_PORT:-7700}:7700 + - 127.0.0.1:${MEILI_PORT:-7700}:7700 networks: - backend volumes: - ${DATA_PATH_HOST}/meili_data:/meili_data - restart: unless-stopped \ No newline at end of file + restart: unless-stopped + + \ No newline at end of file diff --git a/docker/mysql-slave1/Dockerfile b/docker/mysql-slave1/Dockerfile new file mode 100755 index 00000000..10ea8938 --- /dev/null +++ b/docker/mysql-slave1/Dockerfile @@ -0,0 +1,20 @@ +ARG MYSQL_VERSION +FROM mysql:${MYSQL_VERSION} + +LABEL maintainer="Ludovic CANDELLIER " + +##################################### +# Set Timezone +##################################### + +ARG TZ=UTC +ENV TZ ${TZ} +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && chown -R mysql:root /var/lib/mysql/ + +COPY my.cnf /etc/mysql/conf.d/my.cnf + +RUN chmod 0444 /etc/mysql/conf.d/my.cnf + +CMD ["mysqld"] + +EXPOSE 3306 diff --git a/docker/mysql-slave1/my.cnf b/docker/mysql-slave1/my.cnf new file mode 100755 index 00000000..ce2437cb --- /dev/null +++ b/docker/mysql-slave1/my.cnf @@ -0,0 +1,15 @@ +# The MySQL Client configuration file. +# +# For explanations see +# http://dev.mysql.com/doc/mysql/en/server-system-variables.html + +[mysql] + +[mysqld] +sql-mode="STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION" +character-set-server=utf8 +default-authentication-plugin=mysql_native_password +#[Must] Start Binary Logs +log-bin=mysql-bin +#[Must] Set the unique ID of the server, default 1, usually the last segment of IP +server-id=3002