akaunting / docker

Docker Image for Akaunting
https://github.com/akaunting/akaunting
GNU General Public License v3.0
184 stars 86 forks source link

Question about migrating #70

Open farzadha2 opened 2 years ago

farzadha2 commented 2 years ago

Hi Currently i have akaunting working on VM but i want to migrate to docker, What i did is to copy the files and the .sql files and put a docker compose, normally this worked for me when i migrate a wordpress site but im getting a white page when i go to the URL

This is the docker compose

version: '3.7'

services:

  akaunting:
    container_name: akaunting
    image: docker.io/akaunting/akaunting:latest
    build:
      context: .
    ports:
      - 8080:80
    volumes:
      - /akaunting/akaunting/storage:/var/www/html/storage
      - /akaunting/akaunting/modules:/var/www/html/modules
    restart: unless-stopped
    env_file:
      - env/run.env
    environment:
      - AKAUNTING_SETUP
    depends_on:
      - akaunting-db

  akaunting-db:
    container_name: akaunting-db
    image: mariadb
    volumes:
      - /akaunting/akaunting-db.sql:/docker-entrypoint-initdb.d/init.sql:rw # prepopulate database
      - /akaunting/db_data:/var/lib/mysql:rw # persist database data inside docker storage
    restart: unless-stopped
    env_file:
      - env/db.env

  akaunting-update:
    image: containrrr/watchtower
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock

    command: --cleanup akaunting akaunting-db

volumes:
  akaunting-data:
  akaunting-modules:
  akaunting-db:

This are the files locations

root@homelab:~# ls -lah /akaunting/akaunting/storage
total 28K
drwxr-xr-x  7 www-data root     4.0K May 30  2021 .
drwxr-xr-x 13 www-data www-data 4.0K Jun  2  2021 ..
drwxr-xr-x  5 www-data root     4.0K May 30  2021 app
drwxr-xr-x  2 www-data root     4.0K Jun  2  2021 debugbar
drwxr-xr-x  2 www-data root     4.0K May 30  2021 fonts
drwxr-xr-x  6 www-data root     4.0K May 30  2021 framework
drwxr-xr-x  2 www-data root     4.0K Jun 27 21:02 logs
root@homelab:~# ls -lah /akaunting/akaunting/modules/
total 20K
drwxr-xr-x  5 www-data root     4.0K May 30  2021 .
drwxr-xr-x 13 www-data www-data 4.0K Jun  2  2021 ..
drwxr-xr-x 12 www-data root     4.0K May 30  2021 BC21
drwxr-xr-x  8 www-data root     4.0K May 30  2021 OfflinePayments
drwxr-xr-x  7 www-data root     4.0K May 30  2021 PaypalStandard
root@homelab:~# ls -lah /akaunting/
total 36K
drwxr-xr-x  5 www-data         www-data         4.0K Jun 27 21:01 .
drwxr-xr-x 22 root             root             4.0K Jun 27 20:53 ..
drwxr-xr-x 13 www-data         www-data         4.0K Jun  2  2021 akaunting
-rwxr-xr-x  1 www-data         www-data          12K Jun 27 20:58 akaunting-db.sql
drwxr-xr-x  6 systemd-coredump systemd-coredump 4.0K Jun 27 21:02 db_data
-rwxr-xr-x  1 www-data         www-data         1012 Jun 27 21:00 docker-compose.yml
drwxr-xr-x  2 www-data         www-data         4.0K Jun 27 20:58 env

my env files

root@homelab:~/env# cat db.env
# These could be changed
MYSQL_DATABASE=akaunting
MYSQL_USER=admin

# This should definitely be changed to something long and random
MYSQL_PASSWORD=mypassword

# You should probably leave this
MYSQL_RANDOM_ROOT_PASSWORD=yes

root@homelab:~/env# cat run.env
# You should change this to match your reverse proxy DNS name and protocol
APP_URL=http://localhost:8080
LOCALE=en-US

# Don't change this unless you rename your database container or use rootless podman, in case of using rootless podman you should set it to 127.0.0.1 (NOT localhost)
DB_HOST=akaunting-db

# Change these to match env/db.env
DB_DATABASE=akaunting
DB_USERNAME=admin
DB_PASSWORD=mypassword

# You should change this to a random string of three numbers or letters followed by an underscore
DB_PREFIX=asd_

# These define the first company to exist on this instance. They are only used during setup.
COMPANY_NAME=My Company
COMPANY_EMAIL=my@company.com

# This will be the first administrative user created on setup.
ADMIN_EMAIL=me@company.com
ADMIN_PASSWORD=password

Thank you

farzadha2 commented 2 years ago

bump?