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

GHCR deployment issue #34

Open
aniel300 opened this issue Dec 20, 2024 · 16 comments
Open

GHCR deployment issue #34

aniel300 opened this issue Dec 20, 2024 · 16 comments
Assignees
Labels
deployment help wanted Extra attention is needed

Comments

@aniel300
Copy link

can u make everything into one container and publish the image to the dockerhub or GH to be able to deploy with docker compose?

@antebrl
Copy link
Owner

antebrl commented Dec 20, 2024

publish the image to the dockerhub or GH to be able to deploy with docker compose?

The images are already on the github container registry. There is a desired docker-compose.yml for that.
I don't see any advantages of coupling backend and frontend into one container tho. Just deploy it using docker compose.

I hope this helps!

@antebrl antebrl self-assigned this Dec 20, 2024
@aniel300
Copy link
Author

ok i will try, thank you

@aniel300 aniel300 reopened this Dec 25, 2024
@aniel300
Copy link
Author

i tried to adapt and deploy with the compose example but i failed. can u help me please? here is my current set up

  IPTV_Restream_frontend:
    image: ghcr.io/antebrl/iptv-restream/frontend:v1

  IPTV_Restream_backend:
    image: ghcr.io/antebrl/iptv-restream/backend:v1
    volumes:
      - /data/docker/IPTV_Restream/streams:/streams
    environment:
      DEFAULT_CHANNEL_URL: https://mcdn.daserste.de/daserste/de/master.m3u8
      STORAGE_PATH: /streams/

  # Nginx Reverse Proxy
  IPTV_Restream_nginx:
    image: nginx:alpine
    volumes:
      - /data/docker/IPTV_Restream/nginx:/etc/nginx/nginx.conf
      - /data/docker/IPTV_Restream/streams:/streams
    ports:
      - "8086:80"

@aniel300 aniel300 reopened this Dec 25, 2024
@aniel300
Copy link
Author

here is a terminal error screeshot
image

@antebrl
Copy link
Owner

antebrl commented Dec 25, 2024

It's my bad, I forgot to remove the link to the local nginx.conf, so without the nginx.conf the deployment would fail.
I integrated the nginx.conf into the nginx-image now (fbffea8). Try again with the updated docker-compose file.

I also pushed the new version, so you'll get all updates! Every release the images will be updated.

I hope this helps. If you have any more problems reach out. If you're adopting the docker compose for your needs, please explain the adoptions thereby to ensure a quick resolution.

@antebrl antebrl added the help wanted Extra attention is needed label Dec 25, 2024
@aniel300
Copy link
Author

am getting this error now

/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
10-listen-on-ipv6-by-default.sh: info: Enabled listen on IPv6 in /etc/nginx/conf.d/default.conf
/docker-entrypoint.sh: Sourcing /docker-entrypoint.d/15-local-resolvers.envsh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
2024/12/29 19:36:55 [emerg] 1#1: host not found in upstream "frontend" in /etc/nginx/nginx.conf:22
nginx: [emerg] host not found in upstream "frontend" in /etc/nginx/nginx.conf:22
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: IPv6 listen already enabled
/docker-entrypoint.sh: Sourcing /docker-entrypoint.d/15-local-resolvers.envsh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
2024/12/29 19:37:05 [emerg] 1#1: host not found in upstream "frontend" in /etc/nginx/nginx.conf:22
nginx: [emerg] host not found in upstream "frontend" in /etc/nginx/nginx.conf:22

is the nginx mandatory if i have my own reverse proxy?

@aniel300
Copy link
Author

my current docker compose info is as follow:

  IPTV_Restream_frontend:
    image: ghcr.io/antebrl/iptv-restream/frontend:v2

  IPTV_Restream_backend:
    image: ghcr.io/antebrl/iptv-restream/backend:v2
    volumes:
      - /docker/IPTV_Restream/streams:/streams
    environment:
      DEFAULT_CHANNEL_URL: https://mcdn.daserste.de/daserste/de/master.m3u8
      STORAGE_PATH: /streams/

  IPTV_Restream_nginx:
    image: ghcr.io/antebrl/iptv-restream/nginx:v2
    volumes:
      - /docker/IPTV_Restream/streams:/streams
    ports:
      - "8086:80"

@antebrl
Copy link
Owner

antebrl commented Dec 30, 2024

2024/12/29 19:37:05 [emerg] 1#1: host not found in upstream "frontend" in /etc/nginx/nginx.conf:22
nginx: [emerg] host not found in upstream "frontend" in /etc/nginx/nginx.conf:22

You need to have the docker network defined in your compose, as the traffic is routed to the containers through it.
Line 22 in etc/nginx/nginx.conf:

proxy_pass http://frontend:80;

To define the docker network you have to put:

networks:
  app-network:
    driver: bridge

I don't know why you have deleted it in your docker-compose.yml, but if there is any good reason, then you might have to rewrite the nginx.conf. Therefore you would use the nginx:alpine image again instead of the preconfigured one:

IPTV_Restream_nginx:
    image: nginx:alpine
    volumes:
      - {pathToRewrittenNginx}:/etc/nginx/nginx.conf
      - /data/docker/IPTV_Restream/streams:/streams
    ports:
      - "8086:80"

Replace {pathToRewrittenNginx} accordingly.


is the nginx mandatory if i have my own reverse proxy?

Yes and No. It is probably the best option to use it. It facilitates complexer routing especially for the restream mode. You could implement this logic directly in your own reverse proxy. But I may change some things in the nginx.conf in the future, which you would have to keep track and adapt to.
Here is also an example on how I used it together with an additional reverse proxy (for SSL handling) upfront.

@aniel300
Copy link
Author

here is a terminal error screeshot image

if u do what u suggested then i get this error

@antebrl
Copy link
Owner

antebrl commented Dec 31, 2024

If you have added

networks:
  app-network:
    driver: bridge

make sure to add to every container:

networks:
     - app-network

And also make sure paths like /docker/IPTV_Restream/streams exist in your directory.

My suggestion is trying with the basic docker-compose.yml as it is first and only changing the port mapping:

version: "3.9"
services:
  frontend:
    image: ghcr.io/antebrl/iptv-restream/frontend:v2
    networks:
      - app-network

  backend:
    image: ghcr.io/antebrl/iptv-restream/backend:v2
    volumes:
      - streams_data:/streams
    environment:
      DEFAULT_CHANNEL_URL: https://mcdn.daserste.de/daserste/de/master.m3u8
      STORAGE_PATH: /streams/
    networks:
      - app-network

  # Nginx Reverse Proxy
  nginx:
    image: ghcr.io/antebrl/iptv-restream/nginx:v2
    volumes:
      - streams_data:/streams
    ports:
      - "80:80" # Configure exposed port, if 80 is already in use e.g. 8080:80
    networks:
      - app-network

volumes:
  streams_data:
    driver: local
    driver_opts:
      type: tmpfs
      device: tmpfs

# Internal docker network
networks:
  app-network:
    driver: bridge

This is the only thing I tested and which will defitenly work.
Afterwards you can change things one by one. If any of these causes the application to break, you have identified the cause.

@aniel300
Copy link
Author

i only use the docker default network and the paths do exist

@aniel300
Copy link
Author

also i cant use ur docker sample default port because another container of mine is using it

@aniel300
Copy link
Author

i also dont use virtual volumes, i use bind/ my local host fs

@aniel300
Copy link
Author

aniel300 commented Jan 2, 2025

any update on this?

@antebrl
Copy link
Owner

antebrl commented Jan 2, 2025

I think I figured it out.
The problem was not the default docker network or missing virtual volumes.
It was the naming of the docker containers:
The docker containers have to be named the same in the docker-compose.yml and the nginx.conf.

I have updated the naming and you can use it like this:

version: "3.9"
services:
  iptv_restream_frontend:
      image: ghcr.io/antebrl/iptv-restream/frontend:v2.1

  iptv_restream_backend:
    image: ghcr.io/antebrl/iptv-restream/backend:v2.1
    volumes:
      - /docker/IPTV_Restream/streams:/streams
    environment:
      DEFAULT_CHANNEL_URL: https://mcdn.daserste.de/daserste/de/master.m3u8
      STORAGE_PATH: /streams/

  iptv_restream_nginx:
    image: ghcr.io/antebrl/iptv-restream/nginx:v2.1
    volumes:
      - /docker/IPTV_Restream/streams:/streams
    ports:
      - "8086:80"

I tested it, so it should just work like this!
Thanks for your patience.

@antebrl antebrl changed the title can u make everything into one container and publish the image to the dockerhub or GH to be able to deploy with docker compose? GHCR deployment issue Jan 2, 2025
@aniel300
Copy link
Author

aniel300 commented Jan 2, 2025

perfect and thank you for helping me with this. i will check the fix soon and report back. happy new year 🙏🤝

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

No branches or pull requests

2 participants