Closed hargata closed 10 months ago
This would be great! As a windows only platform excludes a lot of selfhosting users.
Adding the following Dockerfile to the top level of your repo should get you started on containerization. I just built it locally from your 1.0.1 release and had it up and running perfectly.
Followed this from Microsoft.
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
WORKDIR /App
COPY . ./
RUN dotnet restore
RUN dotnet publish -c Release -o out
FROM mcr.microsoft.com/dotnet/aspnet:8.0
WORKDIR /App
COPY --from=build-env /App/out .
EXPOSE 5000
CMD ["./CarCareTracker"]
Edit: I did have to change the localhost:5000
to 0.0.0.0:5000
to get the app to listen on the proper adapter.
Lol @ionyx0 this would have saved me some research (I've never had to build a Dotnet Docker file from scratch)
@hargata I have created a PR for this which does work. Please review and let me know if you have any questions. #5
@FFCoder me either! I'm not a Dotnet developer so had basically zero to go on. I posted here as soon as I got it working hoping I could help @hargata or someone else along. Thanks for the PR!
I added a docker compose, can anyone verify if that works?
@hargata I may be mistaken, but I believe you can simplify the volume definitions a little bit since I believe this will largely be used as an example (the user will supply their own paths to where they want the volumes stored)
As an example, here is the plex example from LinuxServer ( a popular maintainer of Dockerfiles for self-hosted services)
@FFCoder I will get on that, thank you!
I added a docker compose, can anyone verify if that works?
@hargata Confirmed working here (Linux)
Working here as well with Linux. Great work
Your docker-compose will work on your workstation, were the bind mount paths match to the project path. Beside this c: paths are usable under windows only, but most docker systems are running Linux based, I guess. So we want to as generic / compatible as possible and use named mounts.
In my pull request I used named mounts. This way docker manages where to store the data.
At Linux systems the default path is
/var/lib/docker/volumes/
I added labels for a setup with the commonly used Traefik proxy server, too. But it works standalone without modification, too.
If you have any questions, just give me a shout. I can test and debug with windows and linux. And I am familiar with docker since years.
Would you like to have a look at my pr #6?
@florianschroen It is merged, I'll make a copy of the docker compose with the traefik portion commented out as well
Can anyone test the docker container again? If it's good I can close this FR.
Can anyone test the docker container again? If it's good I can close this FR.
@hargata Works for me here using the current docker-compose.yml
.
You can have a look at pr #8.
In addition, I saw a bug while testing the container.
The money amounts are prefixed with a symbol which is not displayed correctly. I guess yourintention was a $ sign prefix?
Do we want to include this charset encoding error in this FR? Or do we want to close it and handle the bug separately?
@florianschroen I believe that might be related to FR #3 Seems like dockerization is complete, I will close this FR
Containerize the app.