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

Docker Container #1

Closed
hargata opened this issue Jan 6, 2024 · 16 comments
Closed

Docker Container #1

hargata opened this issue Jan 6, 2024 · 16 comments
Assignees

Comments

@hargata
Copy link
Owner

hargata commented Jan 6, 2024

Containerize the app.

@hargata hargata self-assigned this Jan 6, 2024
@fawqsir
Copy link

fawqsir commented Jan 6, 2024

This would be great! As a windows only platform excludes a lot of selfhosting users.

@ionyx0
Copy link

ionyx0 commented Jan 6, 2024

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.

florianschroen added a commit to florianschroen/lubelog that referenced this issue Jan 6, 2024
adding changes suggested by hargata#1 (comment)
@FFCoder
Copy link
Contributor

FFCoder commented Jan 6, 2024

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

@ionyx0
Copy link

ionyx0 commented Jan 6, 2024

@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!

@hargata
Copy link
Owner Author

hargata commented Jan 6, 2024

I added a docker compose, can anyone verify if that works?

@FFCoder
Copy link
Contributor

FFCoder commented Jan 6, 2024

@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)

image

@hargata
Copy link
Owner Author

hargata commented Jan 6, 2024

@FFCoder I will get on that, thank you!

@ionyx0
Copy link

ionyx0 commented Jan 6, 2024

I added a docker compose, can anyone verify if that works?

@hargata Confirmed working here (Linux)

@zbellerose
Copy link

Working here as well with Linux. Great work

@florianschroen
Copy link
Contributor

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/<volume_name>/_data/

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.

@florianschroen
Copy link
Contributor

Would you like to have a look at my pr #6?

@hargata
Copy link
Owner Author

hargata commented Jan 6, 2024

@florianschroen It is merged, I'll make a copy of the docker compose with the traefik portion commented out as well

@hargata
Copy link
Owner Author

hargata commented Jan 6, 2024

Can anyone test the docker container again? If it's good I can close this FR.

@ionyx0
Copy link

ionyx0 commented Jan 6, 2024

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.

@florianschroen
Copy link
Contributor

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?

@hargata
Copy link
Owner Author

hargata commented Jan 6, 2024

@florianschroen I believe that might be related to FR #3
Seems like dockerization is complete, I will close this FR

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

6 participants