Blame
| 48e3bd | Freedom | 2026-01-29 17:58:28 | 1 | # Monica |
| 2 | ||||
| 3 | ```yaml |
|||
| 4 | version: "3.9" |
|||
| 5 | ||||
| 6 | services: |
|||
| 7 | certbot: |
|||
| 8 | image: certbot/certbot:latest |
|||
| 9 | container_name: certbot |
|||
| 10 | volumes: |
|||
| 11 | - ./certbot/www:/var/www/certbot |
|||
| 12 | - ./certbot/conf:/etc/letsencrypt |
|||
| 13 | ||||
| 14 | nginx: |
|||
| 15 | image: nginx:alpine |
|||
| 16 | container_name: nginx |
|||
| 17 | restart: unless-stopped |
|||
| 18 | depends_on: |
|||
| 19 | - freshrss |
|||
| 20 | - wallabag |
|||
| 21 | ports: |
|||
| 22 | - "80:80" |
|||
| 23 | - "443:443" |
|||
| 24 | volumes: |
|||
| 25 | - ./nginx/conf.d:/etc/nginx/conf.d:ro |
|||
| 26 | - ./certbot/www:/var/www/certbot:ro |
|||
| 27 | - ./certbot/conf:/etc/letsencrypt:ro |
|||
| 28 | ||||
| 29 | postgres: |
|||
| 30 | image: postgres:16 |
|||
| 31 | container_name: postgres |
|||
| 32 | restart: unless-stopped |
|||
| 33 | environment: |
|||
| 34 | POSTGRES_USER: postgres |
|||
| 35 | POSTGRES_PASSWORD: change_this_admin_password |
|||
| 36 | volumes: |
|||
| 37 | - ./postgres_data:/var/lib/postgresql/data |
|||
| 38 | - ./initdb:/docker-entrypoint-initdb.d |
|||
| 39 | ports: |
|||
| 40 | - "5432:5432" |
|||
| 41 | ||||
| 42 | freshrss: |
|||
| 43 | image: freshrss/freshrss:latest |
|||
| 44 | container_name: freshrss |
|||
| 45 | restart: unless-stopped |
|||
| 46 | depends_on: |
|||
| 47 | - postgres |
|||
| 48 | environment: |
|||
| 49 | TZ: UTC |
|||
| 50 | volumes: |
|||
| 51 | - ./freshrss_data:/var/www/FreshRSS/data |
|||
| 52 | - ./freshrss_extensions:/var/www/FreshRSS/extensions |
|||
| 53 | ||||
| 54 | wallabag: |
|||
| 55 | image: wallabag/wallabag:latest |
|||
| 56 | container_name: wallabag |
|||
| 57 | restart: unless-stopped |
|||
| 58 | depends_on: |
|||
| 59 | - postgres |
|||
| 60 | environment: |
|||
| 61 | SYMFONY__ENV__DOMAIN_NAME: "https://wallabag.manxialiu.org" |
|||
| 62 | SYMFONY__ENV__DATABASE_DRIVER: pdo_pgsql |
|||
| 63 | SYMFONY__ENV__DATABASE_HOST: postgres |
|||
| 64 | SYMFONY__ENV__DATABASE_PORT: 5432 |
|||
| 65 | SYMFONY__ENV__DATABASE_NAME: wallabag |
|||
| 66 | SYMFONY__ENV__DATABASE_USER: wallabag |
|||
| 67 | SYMFONY__ENV__DATABASE_PASSWORD: change_this_wallabag_password |
|||
| 68 | volumes: |
|||
| 69 | - ./wallabag/data:/var/www/wallabag/data |
|||
| 70 | - ./wallabag/images:/var/www/wallabag/web/assets/images |
|||
| 71 | monica: |
|||
| 72 | image: monica:latest |
|||
| 73 | container_name: monica |
|||
| 74 | restart: unless-stopped |
|||
| 75 | depends_on: |
|||
| 76 | - monica_db |
|||
| 77 | environment: |
|||
| 78 | APP_ENV: production |
|||
| 79 | APP_KEY: base64:SvGCjh161p/00kgNrZm7E8xhotqnpX94d46w8cnkM0g= |
|||
| 80 | APP_DEBUG: "false" |
|||
| 81 | APP_URL: https://monica.manxialiu.org |
|||
| 82 | DB_CONNECTION: mysql |
|||
| 83 | DB_HOST: monica_db |
|||
| 84 | DB_PORT: 3306 |
|||
| 85 | DB_DATABASE: monica |
|||
| 86 | DB_USERNAME: monica |
|||
| 87 | DB_PASSWORD: change_this_monica_password |
|||
| 88 | TRUSTED_PROXIES: "**" |
|||
| 89 | volumes: |
|||
| 90 | - ./monica_data:/var/www/html/storage |
|||
| 91 | monica_db: |
|||
| 92 | image: mariadb:11 |
|||
| 93 | container_name: monica_db |
|||
| 94 | restart: unless-stopped |
|||
| 95 | environment: |
|||
| 96 | MARIADB_DATABASE: monica |
|||
| 97 | MARIADB_USER: monica |
|||
| 98 | MARIADB_PASSWORD: change_this_monica_password |
|||
| 99 | MARIADB_ROOT_PASSWORD: change_this_root_password |
|||
| 100 | volumes: |
|||
| 101 | - ./monica_db_data:/var/lib/mysql |
|||
| 102 | ``` |
|||
| 103 | ||||
| 104 | ## Data migration |
|||
| 105 | ||||
| 106 | ||||
| 107 | ## Copy the Monica application data |
|||
| 108 | ||||
| 109 | * Copy the Monica volume from the old server to the new server. |
|||
| 110 | * Use the volume path from your Docker Compose file. |
|||
| 111 | ||||
| 112 | ## Dump the Monica database (old server) |
|||
| 113 | ||||
| 114 | Dump the database using the credentials from the old server: |
|||
| 115 | ||||
| 116 | ```bash |
|||
| 117 | docker compose exec db mariadb-dump -u monica -psecret monica > monica.sql |
|||
| 118 | ``` |
|||
| 119 | ||||
| 120 | Copy `monica.sql` to the new server. |
|||
| 121 | {% endstep %} |
|||
| 122 | ||||
| 123 | {% step %} |
|||
| 124 | ## Restore the Monica database (new server) |
|||
| 125 | ||||
| 126 | Import into the new database container (for example, `monica_db`): |
|||
| 127 | ||||
| 128 | ```bash |
|||
| 129 | docker compose exec -T monica_db mariadb -u monica -pchange_this_monica_password monica < monica.sql |
|||
| 130 | ``` |
