Merge pull request #14 from hargata/Hargata/ghcr.auto

Update docker compose file and move env to own file.
This commit is contained in:
Hargata Softworks
2024-01-07 07:30:05 -07:00
committed by GitHub
6 changed files with 14 additions and 5 deletions

2
.env Normal file
View File

@@ -0,0 +1,2 @@
LC_ALL=en_US.UTF-8
LANG=en_US.UTF-8

View File

@@ -55,6 +55,11 @@ namespace CarCareTracker.Controllers
{
try
{
if (!System.IO.File.Exists("config/userConfig.json"))
{
//if file doesn't exist it might be because it's running on a mounted volume in docker.
System.IO.File.WriteAllText("config/userConfig.json", System.Text.Json.JsonSerializer.Serialize(new UserConfig()));
}
var configFileContents = System.IO.File.ReadAllText("config/userConfig.json");
var existingUserConfig = System.Text.Json.JsonSerializer.Deserialize<UserConfig>(configFileContents);
if (existingUserConfig is not null)

View File

@@ -9,6 +9,4 @@ FROM mcr.microsoft.com/dotnet/aspnet:8.0
WORKDIR /App
COPY --from=build-env /App/out .
EXPOSE 8080
ENV LC_ALL=en_US.UTF-8 \
LANG=en_US.UTF-8
CMD ["./CarCareTracker"]

View File

@@ -27,7 +27,7 @@
<span class="ms-2 badge bg-primary">@($"Max Fuel Economy: {Model.Max(x => x.MilesPerGallon).ToString("F") ?? "0"}")</span>
}
<span class="ms-2 badge bg-success">@($"Total Fuel Consumed: {Model.Sum(x=>x.Gallons).ToString("F")}")</span>
<span class="ms-2 badge bg-success">@($"Total Cost: {Model.Sum(x => x.Cost).ToString("C")}")</span>
<span class="ms-2 badge bg-success">@($"Total Cost: {Model.Sum(x => x.Cost).ToString("C3")}")</span>
</div>
@if (enableCsvImports)
{
@@ -66,8 +66,8 @@
<td class="col-2">@gasRecord.Mileage</td>
<td class="col-2">@gasRecord.Gallons.ToString("F")</td>
<td class="col-4">@(gasRecord.MilesPerGallon == 0 ? "---" : gasRecord.MilesPerGallon.ToString("F"))</td>
<td class="col-1">@gasRecord.Cost.ToString("C")</td>
<td class="col-1">@gasRecord.CostPerGallon.ToString("C")</td>
<td class="col-1">@gasRecord.Cost.ToString("C3")</td>
<td class="col-1">@gasRecord.CostPerGallon.ToString("C3")</td>
</tr>
}
</tbody>

View File

@@ -16,6 +16,8 @@ services:
# expose port and/or use serving via traefik
ports:
- 8080:8080
env_file:
- .env
# traefik configurations, including networks can be commented out if not needed
networks:
- traefik-ingress

View File

@@ -16,6 +16,8 @@ services:
# expose port and/or use serving via traefik
ports:
- 8080:8080
env_file:
- .env
volumes:
config: