mirror of
https://github.com/hargata/lubelog.git
synced 2025-12-10 00:46:08 -06:00
dockerSupport: Added Basic Docker support to the application.
This commit is contained in:
parent
1c2368f5a1
commit
71c2e64daf
1
.gitignore
vendored
1
.gitignore
vendored
@ -3,6 +3,7 @@ bin/
|
||||
obj/
|
||||
wwwroot/images/
|
||||
cartracker.db
|
||||
data/cartracker.db
|
||||
wwwroot/documents/
|
||||
wwwroot/temp/
|
||||
wwwroot/imports/
|
||||
|
||||
16
Dockerfile
Normal file
16
Dockerfile
Normal file
@ -0,0 +1,16 @@
|
||||
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 .
|
||||
|
||||
ENTRYPOINT [ "dotnet", "CarCareTracker.dll" ]
|
||||
@ -6,7 +6,7 @@ namespace CarCareTracker.External.Implementations
|
||||
{
|
||||
public class CollisionRecordDataAccess : ICollisionRecordDataAccess
|
||||
{
|
||||
private static string dbName = "cartracker.db";
|
||||
private static string dbName = "data/cartracker.db";
|
||||
private static string tableName = "collisionrecords";
|
||||
public List<CollisionRecord> GetCollisionRecordsByVehicleId(int vehicleId)
|
||||
{
|
||||
|
||||
@ -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)
|
||||
{
|
||||
|
||||
2
External/Implementations/NoteDataAccess.cs
vendored
2
External/Implementations/NoteDataAccess.cs
vendored
@ -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)
|
||||
{
|
||||
|
||||
@ -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)
|
||||
{
|
||||
|
||||
@ -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)
|
||||
{
|
||||
|
||||
@ -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)
|
||||
{
|
||||
|
||||
@ -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
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
"Kestrel": {
|
||||
"Endpoints": {
|
||||
"http": {
|
||||
"Url": "http://localhost:5000"
|
||||
"Url": "http://0.0.0.0:5000"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
3
data/README.MD
Normal file
3
data/README.MD
Normal file
@ -0,0 +1,3 @@
|
||||
# Data Directory
|
||||
## Purpose:
|
||||
Used to store the LiteDB database file. This directory can be mounted as a volume in the Dockerfile.
|
||||
Loading…
x
Reference in New Issue
Block a user