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

smartfriends-bridge RestApi as stand alone container #6

Closed
TrampiPW opened this issue Jan 5, 2024 · 9 comments
Closed

smartfriends-bridge RestApi as stand alone container #6

TrampiPW opened this issue Jan 5, 2024 · 9 comments

Comments

@TrampiPW
Copy link

TrampiPW commented Jan 5, 2024

Hi GimpArm,
die smartfriends-bridge läuft super unter Home Assistant.
Da ich HA aber nur nutze, um diesen RestApi nutzen zu können, würde ich einen eigenen Dockercontainer für diese Zwecke vorziehen. Wie kann ich den aus dem zur Verfügung gestellten Dockerfile erzeugen. Welche Argumente muss ich beim docker build angeben?
Danke für die super Arbeit
Markus

@GimpArm
Copy link
Owner

GimpArm commented Jan 5, 2024

Hi Markus,

There already is a dockerfile in the source repository, this repository is just for the Home Assistant plugin. https://github.com/GimpArm/smartfriends-bridge

Although you don't need to build your own, you can use the normal docker image

docker run -p 8080:80 gimparm/smartfriends-bridge:latest

Although you should mount and configure the settings file /app/appsettings.json
https://github.com/GimpArm/smartfriends-bridge/tree/main#configuration

@TrampiPW
Copy link
Author

TrampiPW commented Jan 5, 2024

Hi,
thanks a lot for this info. I'll try it as soon as possible.
Markus

@TrampiPW
Copy link
Author

TrampiPW commented Jan 6, 2024

Hi GimpAmp,
I tried to start the container but got the following log:
The command could not be loaded, possibly because:

  • You intended to execute a .NET application:
    The application 'SmartFriends.Host.dll' does not exist.
  • You intended to execute a .NET SDK command:
    No .NET SDKs were found.

Download a .NET SDK:
https://aka.ms/dotnet-download

Learn about SDK resolution:
https://aka.ms/dotnet/sdk-not-found

The container is restarting all the time. I guess this is due to the missing .NET component. How can I fix it?

Greetings

Markus

@GimpArm
Copy link
Owner

GimpArm commented Jan 8, 2024

Did you make a new container or are you using the one I pushed to the docker hub?

I double checked what I built, I re-build and pushed a new container. Everything works for me locally as I expect.
This is what I'm running.
'docker run -d -p 5001:80 -v D:\config\smartfriends-bridge\appsettings.json:/app/appsettings.json gimparm/smartfriends-bridge:latest'

If you're still having problems then post your docker command or your compose file.

@TrampiPW
Copy link
Author

TrampiPW commented Jan 8, 2024

I took the container from docker hub as it is.
Maybe the problem is, that I try to use the container on linux (debian).
I use this docker-compose file

version: "2.1"
services:
smartfriendsbridge:
image: gimparm/smartfriends-bridge:latest
container_name: smartfriends-bridge
volumes:
- ./config:/app
ports:
- 18080:8080
restart: unless-stopped

The appsettings.json is placed in ./config and readable by others

@GimpArm
Copy link
Owner

GimpArm commented Jan 8, 2024

There will be no problem running this on a Linux host.

You problem is with your volume, you need to mount the appsettings.json file directly and not the entire app folder.

I should look like this

volumes:
- ./config/appsettings.json:/app/appsettings.json

@TrampiPW
Copy link
Author

TrampiPW commented Jan 8, 2024

Hi,

thanks a lot. The container is up. Now the server refuses to answer. But I hope to find the problem.

Best regards and thanks for your help

Markus

@GimpArm
Copy link
Owner

GimpArm commented Jan 8, 2024

Great, connection problems are usually your network or incorrect settings in the appsettings.json

@GimpArm GimpArm closed this as completed Jan 8, 2024
@TrampiPW
Copy link
Author

TrampiPW commented Jan 8, 2024

it helps to map the correct port ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants