thedaviddelta / lingva-translate

Alternative front-end for Google Translate
https://lingva.thedaviddelta.com
GNU Affero General Public License v3.0
1.55k stars 143 forks source link

Build ARM Images #107

Open FarisZR opened 2 years ago

FarisZR commented 2 years ago

Hi! First thanks for the great project!

I found this Article from docker explaining how to enable Mult-Arch builds in Travis-CI.

I don't use Travis, so I can't test it to see if it works, but I think it should just work. And with Ubuntu Focal being available in Travis, I don't think you need to update docker manually anymore.

I could send you a PR using GH-actions, but you seem to like Travis and I wouldn't want to change your workflow :)

thedaviddelta commented 2 years ago

Hey! Very thanks for this!

I've been trying it, as you can see in the last few commits/PR of the project. Unfortunately, it's giving a very strange error. It seems to not find node on the arm or arm64 builds. You can see the full Travis log here.

I've done some quick search and asked a pair of colleagues, and haven't found any quick fix for it. Maybe it could be some library requirement from the ARM Alpine side in order to node to work, but I can't simply do trial-and-error on the CI. I'll just revert it for the moment. If you have any idea about what the solution could be, please tell me.

Regards, David.

FarisZR commented 2 years ago

Hi, I managed to do it with GH-actions, and it worked flawlessly in my fork of lingva.

would you be OK with a PR migrating the repo to GH-actions with ARM builds and GHCR.io support ?

thedaviddelta commented 2 years ago

Thank you, but I'd prefer to learn them before, or even to think if they're the best solution, as they'd make the project GH-dependant (I know Travis partially already does, but if I migrate I'd like to investigate).

Anyway, this seems like a compile error inside the "lts-alpine" Docker image, not because of the CI. Maybe it was because of a certain image version problem. Let me try it again in some time. Otherwise, I'll just investigate about CIs when I have time again. I'll just let this issue open for the moment in order to have record.

Regards, David.

nghduc97 commented 1 year ago

I think there shouldn't anymore issues on this now. I manage to deploy on ARM server just by changing docker-compose image field to build.

git clone https://github.com/thedaviddelta/lingva-translate

then docker-compose.yml:

version: '3'

services:

  lingva:
    container_name: lingva
    build: ./lingva-translate
    restart: unless-stopped
    environment:
      - site_domain=lingva.ml
      - force_default_theme=light
      - default_source_lang=auto
      - default_target_lang=en
    ports:
      - 3000:3000