Merge pull request #5 from FFCoder/dockerSupport

dockerSupport: Added Basic Docker support to the application.
This commit is contained in:
Hargata Softworks
2024-01-06 09:01:39 -07:00
committed by GitHub
9 changed files with 32 additions and 6 deletions

1
.gitignore vendored
View File

@@ -3,6 +3,7 @@ bin/
obj/
wwwroot/images/
cartracker.db
data/cartracker.db
wwwroot/documents/
wwwroot/temp/
wwwroot/imports/

18
Dockerfile Normal file
View File

@@ -0,0 +1,18 @@
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
WORKDIR /app
COPY *.csproj ./
RUN dotnet restore
COPY . ./
RUN dotnet publish -c Release -o out
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime
WORKDIR /app
RUN mkdir -p /app/data
COPY --from=build-env /app/out .
EXPOSE 5000
ENTRYPOINT [ "dotnet", "CarCareTracker.dll" ]

View File

@@ -6,7 +6,7 @@ namespace CarCareTracker.External.Implementations
{
public class GasRecordDataAccess: IGasRecordDataAccess
{
private static string dbName = "cartracker.db";
private static string dbName = "data/cartracker.db";
private static string tableName = "gasrecords";
public List<GasRecord> GetGasRecordsByVehicleId(int vehicleId)
{

View File

@@ -6,7 +6,7 @@ namespace CarCareTracker.External.Implementations
{
public class NoteDataAccess: INoteDataAccess
{
private static string dbName = "cartracker.db";
private static string dbName = "data/cartracker.db";
private static string tableName = "notes";
public Note GetNoteByVehicleId(int vehicleId)
{

View File

@@ -6,7 +6,7 @@ namespace CarCareTracker.External.Implementations
{
public class ServiceRecordDataAccess: IServiceRecordDataAccess
{
private static string dbName = "cartracker.db";
private static string dbName = "data/cartracker.db";
private static string tableName = "servicerecords";
public List<ServiceRecord> GetServiceRecordsByVehicleId(int vehicleId)
{

View File

@@ -6,7 +6,7 @@ namespace CarCareTracker.External.Implementations
{
public class TaxRecordDataAccess : ITaxRecordDataAccess
{
private static string dbName = "cartracker.db";
private static string dbName = "data/cartracker.db";
private static string tableName = "taxrecords";
public List<TaxRecord> GetTaxRecordsByVehicleId(int vehicleId)
{

View File

@@ -6,7 +6,7 @@ namespace CarCareTracker.External.Implementations
{
public class VehicleDataAccess: IVehicleDataAccess
{
private static string dbName = "cartracker.db";
private static string dbName = "data/cartracker.db";
private static string tableName = "vehicles";
public bool SaveVehicle(Vehicle vehicle)
{

View File

@@ -5,6 +5,13 @@ A self-hosted, open-source vehicle service records and maintainence tracker.
## Why
Because nobody should have to deal with a homemade spreadsheet or a shoebox full of receipts when it comes to vehicle maintainence.
## Docker Setup (Recommended)
1. Install Docker
2. Clone this repo
3. Run `docker build -t lubelog .`
4. Run `docker run -d -p 80:5000 --name lubelog lubelog`
1. Optionally, you can mount a volume to the container to persist data. For example, `docker run -d -p 80:5000 -v /path/to/data:/app/data --name lubelog lubelog`
## Dependencies
- Bootstrap
- LiteDB

View File

@@ -8,7 +8,7 @@
"Kestrel": {
"Endpoints": {
"http": {
"Url": "http://localhost:5000"
"Url": "http://0.0.0.0:5000"
}
}
},