Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Dockerfile and nginx.conf, updated README.md #53

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
</details>
13 changes: 13 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -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;
}
}
}