LycheeOrg / Lychee-Docker

Docker image for Lychee
https://lycheeorg.github.io/
166 stars 55 forks source link

Unable to deploy #88

Closed gxgani closed 2 years ago

gxgani commented 3 years ago

compose-yaml:

---
version: '3'

services:
  lychee_db:
    container_name: lychee_db
    image: mariadb:10
    environment:
      - MYSQL_ROOT_PASSWORD=${DB_PASSWORD}
      - MYSQL_DATABASE=lychee
      - MYSQL_USER=lychee
      - MYSQL_PASSWORD=${DB_PASSWORD}
    expose:
      - 3306
    volumes:
      - mysql:/var/lib/mysql
    networks:
      - lychee
    restart: unless-stopped

  lychee:
    image: lycheeorg/lychee:latest
    container_name: lychee
    ports:
      - 8142:80
    volumes:
      - ./lychee/conf:/conf
      - ./lychee/uploads:/uploads
      - ./lychee/sym:/sym
    networks:
      - lychee
    environment:
      - PHP_TZ=America/New_York
      - DB_CONNECTION=mysql
      - DB_HOST=lychee_db
      - DB_PORT=3306
      - DB_DATABASE=lychee
      - DB_USERNAME=lychee
      - DB_PASSWORD=${DB_PASSWORD}
      - STARTUP_DELAY=5
    restart: unless-stopped
    depends_on:
      - lychee_db

networks:
  lychee:

volumes:
  mysql:

.env:

PUID=1000
PGID=1000
PHP_TZ=America/New_York
DB_CONNECTION=mysql
DB_HOST=db
DB_PORT=3306
DB_DATABASE=lychee
DB_USERNAME=lychee
DB_PASSWORD=password_here
APP_URL='https://domain.tld'

Docker-log:

lychee       | **** Make sure the /conf and /uploads folders exist ****
lychee       | **** Create the symbolic link for the /uploads folder ****
lychee       | **** Create the symbolic link for the /sym folder ****
lychee       | **** Create the symbolic link to the old Lychee-Laravel folder ****
lychee       | **** Copy the .env to /conf ****
lychee       | **** Inject .env values ****
lychee       | **** Generate the key (to make sure that cookies cannot be decrypted etc) ****
lychee       | 
lychee       | **************************************
lychee       | *     Application In Production!     *
lychee       | **************************************
lychee       | 
lychee       | Command Canceled!
lychee       | **** Migrate the database ****
lychee       | 
lychee       | 
lychee       | In Connection.php line 678:
lychee       |                                                                                
lychee       |   SQLSTATE[HY000] [2002] Connection timed out (SQL: select * from information  
lychee       |   _schema.tables where table_schema = lychee and table_name = migrations and   
lychee       |   table_type = 'BASE TABLE')                                                   
lychee       |                                                                                
lychee       | 
lychee       | In Exception.php line 18:
lychee       |                                                
lychee       |   SQLSTATE[HY000] [2002] Connection timed out  
lychee       |                                                
lychee       | 
lychee       | In PDOConnection.php line 38:
lychee       |                                                
lychee       |   SQLSTATE[HY000] [2002] Connection timed out  
lychee       |                                                
lychee       | 
lychee       | **** Check user.css exists and symlink it ****
lychee       | **** Create user and use PUID/PGID ****
lychee       |      User UID :  1000
lychee       |      User GID :  1000
lychee       | **** Set Permissions ****
lychee       | **** Setup complete, starting the server. ****
d7415 commented 3 years ago

Initial thoughts:

gxgani commented 3 years ago

I actually didn't post lychee_db's log but it starts okay. I've tried mixing & matching the DB_HOST from "db" to "lychee_db". None, worked.

PS: without .env, lychee logs as databse [maridb] configuration missing.

gxgani commented 3 years ago

.env and compose db_connnection: lychee_db

Attaching to lychee, lychee_db
lychee       | 
lychee       | -------------------------------------
lychee       |   _               _                
lychee       |  | |   _   _  ___| |__   ___  ___  
lychee       |  | |  | | | |/ __|  _ \ / _ \/ _ \ 
lychee       |  | |__| |_| | (__| | | |  __/  __/ 
lychee       |  |_____\__, |\___|_| |_|\___|\___| 
lychee       |  | |   |___/ _ __ __ ___   _____| |
lychee       |  | |   / _' | '__/ _' \ \ / / _ \ |
lychee       |  | |__| (_| | | | (_| |\ V /  __/ |
lychee       |  |_____\__,_|_|  \__,_| \_/ \___|_|
lychee       | 
lychee       | -------------------------------------
lychee       | Lychee Version: 4.2.2 (release)
lychee       | Lychee Commit:  3274d9a
lychee       | https://github.com/LycheeOrg/Lychee/commit/3274d9aef5ef00126d8006b9161c10538c5b130f
lychee       | -------------------------------------
lychee       | **** Delaying startup (30 seconds)... ****
lychee_db    | 2021-02-27 01:02:14+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 1:10.5.9+maria~focal started.
lychee_db    | 2021-02-27 01:02:14+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
lychee_db    | 2021-02-27 01:02:14+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 1:10.5.9+maria~focal started.
lychee_db    | 2021-02-27  1:02:15 0 [Note] mysqld (mysqld 10.5.9-MariaDB-1:10.5.9+maria~focal) starting as process 1 ...
lychee_db    | 2021-02-27  1:02:15 0 [Note] InnoDB: Uses event mutexes
lychee_db    | 2021-02-27  1:02:15 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
lychee_db    | 2021-02-27  1:02:15 0 [Note] InnoDB: Number of pools: 1
lychee_db    | 2021-02-27  1:02:15 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
lychee_db    | 2021-02-27  1:02:15 0 [Note] mysqld: O_TMPFILE is not supported on /tmp (disabling future attempts)
lychee_db    | 2021-02-27  1:02:15 0 [Note] InnoDB: Using Linux native AIO
lychee_db    | 2021-02-27  1:02:15 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
lychee_db    | 2021-02-27  1:02:15 0 [Note] InnoDB: Completed initialization of buffer pool
lychee_db    | 2021-02-27  1:02:15 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
lychee_db    | 2021-02-27  1:02:15 0 [Note] InnoDB: 128 rollback segments are active.
lychee_db    | 2021-02-27  1:02:15 0 [Note] InnoDB: Creating shared tablespace for temporary tables
lychee_db    | 2021-02-27  1:02:15 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
lychee_db    | 2021-02-27  1:02:15 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
lychee_db    | 2021-02-27  1:02:15 0 [Note] InnoDB: 10.5.9 started; log sequence number 45274; transaction id 20
lychee_db    | 2021-02-27  1:02:15 0 [Note] Plugin 'FEEDBACK' is disabled.
lychee_db    | 2021-02-27  1:02:15 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
lychee_db    | 2021-02-27  1:02:15 0 [Note] Server socket created on IP: '::'.
lychee_db    | 2021-02-27  1:02:15 0 [Note] InnoDB: Buffer pool(s) load completed at 210227  1:02:15
lychee_db    | 2021-02-27  1:02:15 0 [Warning] 'proxies_priv' entry '@% root@4f9560762bfd' ignored in --skip-name-resolve mode.
lychee_db    | 2021-02-27  1:02:15 0 [Note] Reading of all Master_info entries succeeded
lychee_db    | 2021-02-27  1:02:15 0 [Note] Added new Master_info '' to hash table
lychee_db    | 2021-02-27  1:02:15 0 [Note] mysqld: ready for connections.
lychee_db    | Version: '10.5.9-MariaDB-1:10.5.9+maria~focal'  socket: '/run/mysqld/mysqld.sock'  port: 3306  mariadb.org binary distribution
lychee       | **** Make sure the /conf and /uploads folders exist ****
lychee       | **** Create the symbolic link for the /uploads folder ****
lychee       | **** Create the symbolic link for the /sym folder ****
lychee       | **** Create the symbolic link to the old Lychee-Laravel folder ****
lychee       | **** Copy the .env to /conf ****
lychee       | **** Inject .env values ****
lychee       | **** Generate the key (to make sure that cookies cannot be decrypted etc) ****
lychee       | 
lychee       | **************************************
lychee       | *     Application In Production!     *
lychee       | **************************************
lychee       | 
lychee       | Command Canceled!
lychee       | **** Migrate the database ****
lychee       | 
lychee       | 
lychee       | In Connection.php line 678:
lychee       |                                                                                
lychee       |   SQLSTATE[HY000] [2002] Connection timed out (SQL: select * from information  
lychee       |   _schema.tables where table_schema = lychee and table_name = migrations and   
lychee       |   table_type = 'BASE TABLE')                                                   
lychee       |                                                                                
lychee       | 
lychee       | In Exception.php line 18:
lychee       |                                                
lychee       |   SQLSTATE[HY000] [2002] Connection timed out  
lychee       |                                                
lychee       | 
lychee       | In PDOConnection.php line 38:
lychee       |                                                
lychee       |   SQLSTATE[HY000] [2002] Connection timed out  
lychee       |                                                
lychee       | 
lychee       | **** Check user.css exists and symlink it ****
lychee       | **** Create user and use PUID/PGID ****
lychee       |      User UID :  1000
lychee       |      User GID :  1000
lychee       | **** Set Permissions ****
lychee       | **** Setup complete, starting the server. ****
d7415 commented 3 years ago

Ok, so the lychee_db container should be ready for lychee, but the connection isn't working. I think the correct DB_HOST is lychee_db, but I've only used composer briefly while checking the example and tests (which currently aren't running).

gxgani commented 3 years ago

I'm running this along with various other projects. I even tried LinuxServer's image but it's seems to be on a different configuration. I can't seem to establish a link with db and lychee.

gxgani commented 3 years ago

I tried making the SQL server run on host network and I am still not able make lychee connect to the database. It works if I remotely connect to DB or within the host directly, but app just doesn't want to.

Creating lychee_db ... done
Creating lychee    ... done
Attaching to lychee, lychee_db
lychee       | 
lychee       | -------------------------------------
lychee       |   _               _                
lychee       |  | |   _   _  ___| |__   ___  ___  
lychee       |  | |  | | | |/ __|  _ \ / _ \/ _ \ 
lychee       |  | |__| |_| | (__| | | |  __/  __/ 
lychee       |  |_____\__, |\___|_| |_|\___|\___| 
lychee       |  | |   |___/ _ __ __ ___   _____| |
lychee       |  | |   / _' | '__/ _' \ \ / / _ \ |
lychee       |  | |__| (_| | | | (_| |\ V /  __/ |
lychee       |  |_____\__,_|_|  \__,_| \_/ \___|_|
lychee       | 
lychee       | -------------------------------------
lychee       | Lychee Version: 4.2.2 (release)
lychee       | Lychee Commit:  3274d9a
lychee       | https://github.com/LycheeOrg/Lychee/commit/3274d9aef5ef00126d8006b9161c10538c5b130f
lychee       | -------------------------------------
lychee       | **** Delaying startup (5 seconds)... ****
lychee_db    | 2021-02-28 17:40:07+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 1:10.5.9+maria~focal started.
lychee_db    | 2021-02-28 17:40:08+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
lychee_db    | 2021-02-28 17:40:08+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 1:10.5.9+maria~focal started.
lychee_db    | 2021-02-28 17:40:09 0 [Note] mysqld (mysqld 10.5.9-MariaDB-1:10.5.9+maria~focal) starting as process 1 ...
lychee_db    | 2021-02-28 17:40:09 0 [Note] InnoDB: Uses event mutexes
lychee_db    | 2021-02-28 17:40:09 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
lychee_db    | 2021-02-28 17:40:09 0 [Note] InnoDB: Number of pools: 1
lychee_db    | 2021-02-28 17:40:09 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
lychee_db    | 2021-02-28 17:40:09 0 [Note] mysqld: O_TMPFILE is not supported on /tmp (disabling future attempts)
lychee_db    | 2021-02-28 17:40:09 0 [Note] InnoDB: Using Linux native AIO
lychee_db    | 2021-02-28 17:40:09 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
lychee_db    | 2021-02-28 17:40:09 0 [Note] InnoDB: Completed initialization of buffer pool
lychee_db    | 2021-02-28 17:40:09 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
lychee_db    | 2021-02-28 17:40:09 0 [Note] InnoDB: 128 rollback segments are active.
lychee_db    | 2021-02-28 17:40:09 0 [Note] InnoDB: Creating shared tablespace for temporary tables
lychee_db    | 2021-02-28 17:40:09 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
lychee_db    | 2021-02-28 17:40:09 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
lychee_db    | 2021-02-28 17:40:09 0 [Note] InnoDB: 10.5.9 started; log sequence number 45142; transaction id 20
lychee_db    | 2021-02-28 17:40:09 0 [Note] Plugin 'FEEDBACK' is disabled.
lychee_db    | 2021-02-28 17:40:09 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
lychee_db    | 2021-02-28 17:40:09 0 [Note] InnoDB: Buffer pool(s) load completed at 210228 17:40:09
lychee_db    | 2021-02-28 17:40:09 0 [Note] Server socket created on IP: '::'.
lychee_db    | 2021-02-28 17:40:09 0 [Warning] 'proxies_priv' entry '@% root@my-hostname-here' ignored in --skip-name-resolve mode.
lychee_db    | 2021-02-28 17:40:09 0 [Note] Reading of all Master_info entries succeeded
lychee_db    | 2021-02-28 17:40:09 0 [Note] Added new Master_info '' to hash table
lychee_db    | 2021-02-28 17:40:09 0 [Note] mysqld: ready for connections.
lychee_db    | Version: '10.5.9-MariaDB-1:10.5.9+maria~focal'  socket: '/run/mysqld/mysqld.sock'  port: 3911  mariadb.org binary distribution
lychee       | **** Make sure the /conf and /uploads folders exist ****
lychee       | **** Create the symbolic link for the /uploads folder ****
lychee       | **** Create the symbolic link for the /sym folder ****
lychee       | **** Create the symbolic link to the old Lychee-Laravel folder ****
lychee       | **** Copy the .env to /conf ****
lychee       | **** Inject .env values ****
lychee       | **** Generate the key (to make sure that cookies cannot be decrypted etc) ****
lychee       | 
lychee       | **************************************
lychee       | *     Application In Production!     *
lychee       | **************************************
lychee       | 
lychee       | Command Canceled!
lychee       | **** Migrate the database ****
lychee       | 
lychee       | 
lychee       | In Connection.php line 678:
lychee       |                                                                                
lychee       |   SQLSTATE[HY000] [2002] Connection refused (SQL: select * from information_s  
lychee       |   chema.tables where table_schema = lychee and table_name = migrations and ta  
lychee       |   ble_type = 'BASE TABLE')                                                     
lychee       |                                                                                
lychee       | 
lychee       | In Exception.php line 18:
lychee       |                                              
lychee       |   SQLSTATE[HY000] [2002] Connection refused  
lychee       |                                              
lychee       | 
lychee       | In PDOConnection.php line 38:
lychee       |                                              
lychee       |   SQLSTATE[HY000] [2002] Connection refused  
lychee       |                                              
lychee       | 
lychee       | **** Check user.css exists and symlink it ****
lychee       | **** Create user and use PUID/PGID ****
lychee       |      User UID :  1000
lychee       |      User GID :  1000
lychee       | **** Set Permissions ****
lychee       | **** Setup complete, starting the server. ****
root@croque:/home/apps/lychee-photos# docker exec -it lychee_db bash
root@croque:/# mysql -u lychee -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 6
Server version: 10.5.9-MariaDB-1:10.5.9+maria~focal mariadb.org binary distribution

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> 
d7415 commented 3 years ago

.env and compose db_connnection: lychee_db

I suspect you've given up by now, but rereading this I just noticed - This should be DB_HOST. Was that just a typo copying it to here?