Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arm8 docker buid? #14

Closed
houdini69 opened this issue Apr 7, 2023 · 11 comments
Closed

arm8 docker buid? #14

houdini69 opened this issue Apr 7, 2023 · 11 comments
Labels
help wanted Extra attention is needed

Comments

@houdini69
Copy link

Would it be possible to have an arm8 version of our-shopping-list?

@nanawel
Copy link
Owner

nanawel commented Apr 11, 2023

Hi @houdini69
I guess it could be possible but unfortunately this is not a priority in a near future. I'm already struggling to find the time to implement new features 😕

PRs are welcome of course, if someone can take a look at this.

@nanawel nanawel added the help wanted Extra attention is needed label Apr 11, 2023
@richardneish
Copy link

Is this just using "https://hub.docker.com/r/arm64v8/node/" for the Docker images? I haven't done it before, but it looks like it should be a small change, since Node on Arm64v8 is a supported architecture for the official Node image. @houdini69 can you try and submit a PR if you get something working?

@houdini69
Copy link
Author

Is this just using "https://hub.docker.com/r/arm64v8/node/" for the Docker images? I haven't done it before, but it looks like it should be a small change, since Node on Arm64v8 is a supported architecture for the official Node image. @houdini69 can you try and submit a PR if you get something working?

I'm just an end user and don't know how to build a docker image. Therefore, I leave it to someone more knowledgeable than me to test your suggestion!

@houdini69
Copy link
Author

houdini69 commented Dec 9, 2023

I finally tried to build docker image on my Debian Bullseye server and successfully get running container with docker-compose. Container has an "healthy" status. However, I couldn't connect in my LAN on listening port.

My docker-compose configuration
version: '3.2'

services:
app:
image: our-shopping-list:latest
restart: always
ports:
- '8100:8100'
environment:
# Default values below
VUE_APP_I18N_LOCALE: fr
VUE_APP_I18N_FALLBACK_LOCALE: fr
VUE_APP_I18N_FORCE_LOCALE: 0
VUE_APP_SINGLEBOARD_MODE: 0
depends_on:
- mongodb

mongodb:
image: mongo:4
volumes:
- dbdata:/data/db

volumes:
dbdata:

How to debug?

@nanawel
Copy link
Owner

nanawel commented Dec 9, 2023

Hi @houdini69
That's great news, thanks for your time.

Could you use the "three backticks" syntax to format your YAML please? That would help readability a lot.

About your port issue, that seems like an easy detail to fix: you're using 8100 for the internal port while the Node server listens on 8080 by default.
So both alternatives below should work in your docker-compose.yml if you absolutely need your host to listen on 8100 on its interfaces:

...
    ports:
      - '8100:8080'

or

...
    ports:
      - '8100:8100'
    environment:
      LISTEN_PORT: 8100

@houdini69
Copy link
Author

here it is my original docker-compose.yml

version: '3.2'

services:
  app:
    image: our-shopping-list:latest
    restart: always
    ports:
      - '8100:8100'
    environment:
      # Default values below
      VUE_APP_I18N_LOCALE: fr
      VUE_APP_I18N_FALLBACK_LOCALE: fr
      VUE_APP_I18N_FORCE_LOCALE: 0
      VUE_APP_SINGLEBOARD_MODE: 0
    depends_on:
      - mongodb

  mongodb:
    image: mongo:4
    volumes:
      - dbdata:/data/db

volumes:
  dbdata:

I'm going to try your suggestion.

@houdini69
Copy link
Author

Same result: unable to connect to app

@houdini69
Copy link
Author

compose docker logs gives:

docker compose logs
our-shopping-list-app-1 | Using web root: /
our-shopping-list-app-1 | Serving socket-io on /socket.io/
our-shopping-list-app-1 | (node:1) [MONGOOSE] DeprecationWarning: Mongoose: the strictQuery option will be switched back to false by default in Mongoose 7. Use mongoose.set('strictQuery', false); if you want to prepare for this change. Or use mongoose.set('strictQuery', true); to suppress this warning.
our-shopping-list-app-1 | (Use node --trace-deprecation ... to show where the warning was created)
our-shopping-list-app-1 | OSL Server started on [::]:8100
our-shopping-list-app-1 | Current environment: {
our-shopping-list-app-1 | VUE_APP_I18N_FORCE_LOCALE: '0',
our-shopping-list-app-1 | NODE_VERSION: '18.18.2',
our-shopping-list-app-1 | HOSTNAME: 'c85a33766622',
our-shopping-list-app-1 | YARN_VERSION: '1.22.19',
our-shopping-list-app-1 | SHLVL: '1',
our-shopping-list-app-1 | VUE_APP_I18N_LOCALE: 'fr',
our-shopping-list-app-1 | HOME: '/root',
our-shopping-list-app-1 | APP_BUILD_ID: '',
our-shopping-list-app-1 | PATH: '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
our-shopping-list-app-1 | VUE_APP_SINGLEBOARD_MODE: '0',
our-shopping-list-app-1 | LISTEN_PORT: '8100',
our-shopping-list-app-1 | APP_ENV: 'production',
our-shopping-list-app-1 | PWD: '/app',
our-shopping-list-app-1 | VUE_APP_I18N_FALLBACK_LOCALE: 'fr',
our-shopping-list-app-1 | APP_VERSION: ''
our-shopping-list-app-1 | }

and then mongodb infos

@houdini69
Copy link
Author

houdini69 commented Dec 9, 2023

Tried to set a reverse proxy with nginx and got message "Invalid request: GET /ws://127.0.0.1:8100/" in the browser

My reverse proxy nginx configuration:

server {
    listen 80;
    listen [::]:80;
    server_name xxxx.xxxxx.fr;

    if ($allowed_country = no) {
            return 444;
        }

    include /etc/nginx/conf.d/acme-challenge.inc;

    include /etc/nginx/conf.d/xxxx.xxxxx.fr/*.conf;

    access_log /var/log/nginx/xxxx.xxxxx.fr-access.log;
    error_log /var/log/nginx/xxxx.xxxxx.fr-error.log;

	location / {

    # Force usage of https
    if ($scheme = http) {
    rewrite ^ https://$server_name$request_uri? permanent;
   }

     # restriction d'accès
    # proxy_bind $server_addr;
     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
     proxy_set_header X-Forwarded-Host $host;
     proxy_set_header X-Forwarded-Server $host;
     proxy_set_header Host $host;
     proxy_pass http://127.0.0.1:8100;
     rewrite /(.*) /ws://127.0.0.1:8100/$1 break;
     rewrite /(.*) http://127.0.0.1:8100/$1 redirect;

     # Websocket support
     proxy_http_version 1.1;
     proxy_set_header Upgrade $http_upgrade;
     proxy_set_header Connection "Upgrade";
     proxy_read_timeout 86400;
	}
}

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name xxxx.xxxxx.fr;

    if ($allowed_country = no) {
            return 444;
        }

    include /etc/nginx/conf.d/acme-challenge.inc;

    ssl_certificate /etc/letsencrypt/live/xxxxx.fr/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/xxxxx.fr/privkey.pem;

    include /etc/nginx/conf.d/xxxx.xxxxx.fr/*.conf;

    access_log /var/log/nginx/xxxx.xxxxx.fr-access.log;
    error_log /var/log/nginx/xxxx.xxxxx.fr-error.log;
    
    location / {

  # Force usage of https
  if ($scheme = http) {
    rewrite ^ https://$server_name$request_uri? permanent;
  }

    # proxy_bind $server_addr;
     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
     proxy_set_header X-Forwarded-Host $host;
     proxy_set_header X-Forwarded-Server $host;
     proxy_set_header Host $host;
     proxy_pass http://127.0.0.1:8100;
     rewrite /(.*) /ws://127.0.0.1:8100/$1 break;
     rewrite /(.*) http://127.0.0.1:8100/$1 redirect;

     # Websocket support
     proxy_http_version 1.1;
     proxy_set_header Upgrade $http_upgrade;
     proxy_set_header Connection "Upgrade";
     proxy_read_timeout 86400;
	}
}

@nanawel
Copy link
Owner

nanawel commented Dec 9, 2023

I've added an example in the README of what should go into the vhost when using Nginx as a reverse-proxy:
https://github.com/nanawel/our-shopping-list#nginx

You should take a look. You'll notice I don't use rewrite for a start.

@houdini69
Copy link
Author

I finally succeeded by removing those two lines in my reverse proxy nginx config

rewrite /(.*) /ws://127.0.0.1:8100/$1 break;
rewrite /(.*) http://127.0.0.1:8100/$1 redirect;

Thanks for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants