将session通过redis持久化

This commit is contained in:
Easy 2022-01-19 14:29:08 +08:00
parent 2b44e4d5b0
commit 53ce5fd0ea
2 changed files with 8 additions and 1 deletions

View File

@ -8,7 +8,11 @@ services:
- MYSQL_ROOT_PASSWORD=theVeryp@ssw0rd
- MYSQL_DATABASE=pushdeer
ports:
- '3306:3306'
- '3306:3306'
redis:
image: 'bitnami/redis:6.0.16'
environment:
- ALLOW_EMPTY_PASSWORD=yes
app:
#image: 'webdevops/php-apache:8.0-alpine'
build: './docker/web/'
@ -18,6 +22,7 @@ services:
- './:/app'
depends_on:
- mariadb
- redis
environment:
- DB_HOST=mariadb
- DB_PORT=3306

View File

@ -8,6 +8,8 @@ COPY vhost.conf /opt/docker/etc/httpd/vhost.conf
# https://dockerfile.readthedocs.io/en/latest/content/Customization/provisioning.html
COPY init.sh /opt/docker/provision/entrypoint.d/
#CMD chmod +x /opt/docker/provision/entrypoint.d/init.sh
RUN echo "session.save_handler = redis\n" >> /opt/docker/etc/php/php.webdevops.ini
RUN echo "session.save_path = 'tcp://redis:6379'\n" >> /opt/docker/etc/php/php.webdevops.ini
# ADD supervisord-proxy.conf /opt/docker/etc/supervisor.d/prism-proxy.conf
RUN mkdir /data