uvdesk / community-skeleton

UVdesk Opensource Community Helpdesk Project built for all to make a Full Ticketing Support System along with many more other features.
https://www.uvdesk.com
MIT License
7.32k stars 452 forks source link

container not being up with a persistent config in docker-compose.yml exit code 1 #597

Closed Cronist closed 9 months ago

Cronist commented 1 year ago

I am following up here:

https://github.com/uvdesk/community-skeleton/wiki/dockerize-helpdesk-project

I downloaded the zip file. extracted on my ubuntu server. compiles with the command below.

docker build -t uvdesk:latest .

run the container with CLI below

docker run -dit -p 8888:80 -e MYSQL_USER=uvdesk -e MYSQL_ROOT_PASSWORD=rootpassword -e MYSQL_PASSWORD=uvdeskpwd -e MYSQL_DATABASE=uvdesk --name uvdesk uvdesk

it runs without problem.

But when the container is down and restarts, all configs have gone as expected. so I tried to create a persistent data storage for SQL data, ticket attachments, and server-side uploads like logos, etc.

version: '3'

services:
  uvdesk:
    image: uvdesk:latest
    tty: true
    environment:
      MYSQL_USER: uvdesk
      MYSQL_ROOT_PASSWORD: rootpassword
      MYSQL_PASSWORD: uvdeskpwd
      MYSQL_DATABASE: uvdesk
    network_mode: "host"
    ports:
      - 8888:80
    volumes:
      - sql_data:/var/lib/mysql:rw
      - web_data:/var/www/uvdesk/public/assets/website:rw
      - ticket_data:/var/www/uvdesk/public/attachments:rw

volumes:   
 sql_data:
   driver: local
   driver_opts:
    type: none
    device: $PWD/sql-data
    o: bind
 web_data:
  driver: local
  driver_opts:
   type: none
   device: $PWD/web-data
   o: bind
 ticket_data:
  driver: local
  driver_opts:
   type: none
   device: $PWD/ticket-data
   o: bind

The directory structure is like this:

docker-compose.yml
sql-data
ticket-data
web-data

$ docker-compose up
WARNING: The Docker Engine you're using is running in swarm mode.

Compose does not use swarm mode to deploy services to multiple nodes in a swarm. All containers will be scheduled on the current node.

To deploy your application across the swarm, use docker stack deploy.

Recreating doc_uvdesk_1 ... done
Attaching to doc_uvdesk_1
uvdesk_1  |  * Restarting Apache httpd web server apache2                       AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 192.168.1.80. Set the 'ServerName' directive globally to suppress this message
uvdesk_1  |                                                              [ OK ]
uvdesk_1  |  * Stopping MySQL database server mysqld                     [ OK ] 
uvdesk_1  |  * Starting MySQL database server mysqld                            No directory, logging in with HOME=/
uvdesk_1  |                                                              [ OK ]
uvdesk_1  | mysqladmin: connect to server at 'localhost' failed
uvdesk_1  | error: 'Access denied for user 'root'@'localhost' (using password: NO)'
uvdesk_1  | Error: Failed to establish a connection with mysql server (localhost)
uvdesk_1  | 
doc_uvdesk_1 exited with code 1
$
tperrindell commented 1 year ago

Hi,

I think you're mixing up running a container for the DB and one for uvdesk.

You need to run 2 separate ones, and link them in the installer.

komal-sh-27 commented 9 months ago

@Cronist ,

We have created a new blog for docker persistent data. You can follow the below blog steps: https://github.com/uvdesk/community-skeleton/wiki/Docker-Persistent-Container

Also, you can use our official docker image from here: https://hub.docker.com/r/webkul/uvdesk

At this moment, we are closing this issue. If you have further any query then reply on the same thread.

Thanks and Regards, Uvdesk Team