Skip to content

Commit

Permalink
Update Docker to use .NET 6
Browse files Browse the repository at this point in the history
  • Loading branch information
jpsingleton committed Dec 21, 2021
1 parent 286fc8f commit 013d1e2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -344,3 +344,6 @@ healthchecksdb

# Visual Studio Code
.vscode

# Docker build dir
out/
4 changes: 2 additions & 2 deletions Huxley2/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build-env
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build-env
WORKDIR /app

# Copy csproj and restore as distinct layers
Expand All @@ -10,7 +10,7 @@ COPY . ./
RUN dotnet publish -c Release -o out

# Build runtime image
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1
FROM mcr.microsoft.com/dotnet/aspnet:6.0
WORKDIR /app
COPY --from=build-env /app/out .
ENTRYPOINT ["dotnet", "Huxley2.dll"]
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,19 @@ There are detailed instructions on how to host your own instance on Azure in [th
### Running with Docker

1. Ensure you have Docker and Docker Compose installed
2. Create an `.env` file in the `Huxley2` directory with the access tokens. You can delete the ones you're not using. Example:
```
2. Create an `.env` file in the `Huxley2` directory with the access tokens. You can delete the ones you're not using.
3. Run `docker-compose up`
4. The app should be available at `localhost:8081`

Example `.env` file:

```env
ACCESS_TOKEN=abcde12345
STAFF_ACCESS_TOKEN=abcde12345
CLIENT_ACCESS_TOKEN=abcde12345
```
3. Run `docker-compose up`
4. The app should be available at `localhost:8081`

To rebuild use `docker-compose build` or `docker-compose up --build`.

## Station Codes File

Expand Down

0 comments on commit 013d1e2

Please sign in to comment.