diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..59e48fe8 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM mcr.microsoft.com/dotnet/sdk:8.0.403 as build +WORKDIR /app + +COPY Pkmds.sln ./ +COPY ./Pkmds.Web/Pkmds.Web.csproj ./Pkmds/ + +# RUN dotnet restore +COPY . ./ +RUN dotnet publish -c Release -o out + +FROM nginx:1.27-alpine +WORKDIR /app +EXPOSE 8080 +COPY nginx.conf /etc/nginx/nginx.conf +COPY --from=build /app/out/wwwroot /usr/share/nginx/html \ No newline at end of file diff --git a/README.md b/README.md index 3f439f5e..47d60c88 100644 --- a/README.md +++ b/README.md @@ -109,4 +109,13 @@ Q: Can I use PKMDS on my Mac? A: Yes, you can use PKMDS on your Mac. The web app is designed to be used on any device that has a web browser, including Mac computers. +Q: Can I run this locally? + +A: Yes, you can do with docker. +- Install Docker - [Instructions](https://docs.docker.com/get-started/get-docker/) +- Clone the repo with `git clone` +- cd into the PKMDS-Blazor folder +- build the Dockerfile `docker build -t pkmds .` +- run your new container `docker run --name pkmds -d -p 5002:8080` +- access the application at `http://localhost:5002` diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 00000000..a024161d --- /dev/null +++ b/nginx.conf @@ -0,0 +1,13 @@ +events {} +http { + include /etc/nginx/mime.types; + server { + listen 8080; + server_name localhost; + root /usr/share/nginx/html; + index index.html; + location / { + try_files $uri $uri/ /index.html; + } + } +}