Skip to content

Commit

Permalink
Kanalak ez badu estekarik, erakutsi testu lauan esteka batean izan be…
Browse files Browse the repository at this point in the history
…harrean
  • Loading branch information
ikerib committed Aug 10, 2022
1 parent e791a9f commit 8490ac3
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 11 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ DOCKER_MYSQL_DATABASE=zerbikat
DOCKER_TIMEZONE="Europe/Madrid"
PHP_IDE_CONFIG="serverName=zerbikat.test"
XDEBUG_CONFIG="remote_host=192.168.2.8 remote_port=9000"
WITH_XDEBUG=true
USER_ID=1000
GROUP_ID=1000
###< DOCKER ###
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@
/web/doc/
/.idea/Zerbikat.iml
!/.env.local
.env.local
34 changes: 34 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash

APP = zerbikar
VERSION := $(shell cat ./VERSION)
USER_ID = $(shell id -u)
GROUP_ID= $(shell id -g)
user==www-data

help:
@echo 'Erabiltzeko: make [target]'
@echo
@echo 'Agindu erabilgarriak:'
@egrep '^(.+)\:\ ##\ (.+)' ${MAKEFILE_LIST} | column -t -c 2 -s ":#"

build: ## Sortu Docker irudiak
docker compose --env-file .env.local build

build-force: ## Sortu Docker irudiak aurrekoak ezabatzen (--force-rm --no-cache)
docker compose --env-file .env.local build --force-rm --no-cache

restart: ## kontainerrak stop & start
$(MAKE) stop && $(MAKE) run

run: ## kontenedorea abiarazi .env.local erabiliz
docker compose --env-file .env.local up -d

stop: ## kontenedorea gelditu
docker compose down

ssh: ## kontenedorera ssh sarbidea
docker compose exec php bash

cc: ## symfony cache clear
docker compose exec php ./bin/console c:c
Empty file added VERSION
Empty file.
14 changes: 10 additions & 4 deletions app/Resources/views/fitxa/show.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,11 @@
<a href='mailto:{{ kanal.estekaeu }}'>{{ kanal.izenaeu }}</a>
<br/>
{% else %}
<a href='{{ kanal.estekaeu }}'
target="_blank">{{ kanal.izenaeu }}</a><br/>
{% if kanal.estekaeu is null %}
{{ kanal.izenaeu }}
{% else %}
<a href='{{ kanal.estekaeu }}' target="_blank">{{ kanal.izenaeu }}</a><br/>
{% endif %}
{% endif %}
{% endif %}
{% if kanal.eraikina %}{{ kanal.eraikina.izena }}<br/>{% endif %}
Expand Down Expand Up @@ -302,8 +305,11 @@
<a href='mailto:{{ kanal.estekaes }}'>{{ kanal.izenaes }}</a>
<br/>
{% else %}
<a href='{{ kanal.estekaes }}'
target="_blank">{{ kanal.izenaes }}</a><br/>
{% if kanal.estekaes is null %}
{{ kanal.izenaes }}
{% else %}
<a href='{{ kanal.izenaes }}' target="_blank">{{ kanal.izenaes }}</a><br/>
{% endif %}
{% endif %}
{% endif %}
{% if kanal.eraikina %}{{ kanal.eraikina.izena }}<br/>{% endif %}
Expand Down
12 changes: 6 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,29 @@ services:
ports:
- "3306:3306"
networks:
- zzoo
- zerbikatnet
php:
container_name: zerbikat-php
env_file: ./.env
build:
context: .
dockerfile: docker/php/Dockerfile
args:
- WITH_XDEBUG=false
- WITH_XDEBUG=true
- DOCKER_TIMEZONE=${DOCKER_TIMEZONE}
- USER_ID=${USER_ID}
- GROUP_ID=${GROUP_ID}
depends_on:
- mariadb
volumes:
- '.:/usr/src/app'
user: 1000:1000
user: ${USER_ID}:${GROUP_ID}
environment:
- APP_ENV=dev
- PHP_IDE_CONFIG=serverName=zerbikat.test
- XDEBUG_CONFIG=remote_host=192.168.2.8
networks:
- zzoo
- zerbikatnet
nginx:
container_name: zerbikat-nginx
image: nginx:1.15.3-alpine
Expand All @@ -47,11 +47,11 @@ services:
ports:
- 80:80
networks:
- zzoo
- zerbikatnet

volumes:
mariadb_zerbikat:

networks:
zzoo:
zerbikatnet:
driver: bridge
3 changes: 2 additions & 1 deletion docker/php/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ RUN apt-get update && apt-get install -y \
&& echo "LC_ALL=es_ES.UTF-8" >> /etc/default/locale \
&& echo "LANG=es_ES.UTF-8" >> /etc/default/locale

RUN if [ "${WITH_XDEBUG}" = "true" ]; then pecl install xdebug && docker-php-ext-enable xdebug && echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" >> /usr/local/etc/php/php.ini && echo "error_reporting = E_ALL" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini && echo "display_startup_errors = On" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini && echo "display_errors = On" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini && echo "xdebug.remote_enable=1" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini && echo "xdebug.remote_connect_back=1" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini ; fi
RUN pecl install xdebug-2.5.5 && docker-php-ext-enable xdebug && echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" >> /usr/local/etc/php/php.ini && echo "error_reporting = E_ALL" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini && echo "display_startup_errors = On" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini && echo "display_errors = On" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini && echo "xdebug.remote_enable=1" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini && echo "xdebug.remote_connect_back=1" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini


RUN docker-php-ext-install pdo pdo_mysql

Expand Down

0 comments on commit 8490ac3

Please sign in to comment.