question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add Digital Ocean and Docker Use Case

See original GitHub issue

Is your feature request related to a problem? Please describe. Add Docker and Digital Ocean Use Case

Describe the solution you’d like Add Docker and Digital Ocean Use Case

Describe alternatives you’ve considered None

Additional context Issue #14 was helpful, but I think you will increase the use case if you add something obvious to the README.md for Docker.

Basic Steps for Docker in Digital Ocean droplet (.NET CORE)

  1. Configure your web application per the instructions of this repo.
  2. Create Digital Ocean droplet. Under marketplace, there is a Docker image option that has Docker preinstalled.
  3. Point your DNS A record at the Digital Ocean Droplet IP.
  4. Build container and publish container to Docker Hub.

Sample Dockerfile

FROM mcr.microsoft.com/dotnet/core/aspnet:2.1-stretch-slim AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/core/sdk:2.1-stretch AS env

# Copy files from project into Docker /src folder and build project
WORKDIR /src

#Main Project
COPY /*.csproj /myprojectname
COPY . .

#Publish application to app directory
FROM env AS publish
RUN dotnet publish -c Release -o /app

FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "myprojectname.dll"]
  1. Run your container. Assumes your container is working and published to Docker Hub…

docker run -v ~/x509stores/:/root/.dotnet/corefx/cryptography/x509stores/ --name mycontainername -d -p 80:80 -p 443:443 -e “ASPNETCORE_ENVIRONMENT=Production” -e ASPNETCORE_URLS=“http://+;https://+” -e ASPNETCORE_HTTPS_PORT=443 mydockerhubaccount/mycontainername

  1. Navigate to your domain name in the browser.

You could have a $5/month website this way that integrates easily with the CI/CD pipeline. I tested these basic steps and it works, but maybe more details are needed. I think it’s practical for smaller IT companies who don’t want to spend a ton of money to host a website.

Yeah, that’s kind of a mess, but if there is value in it, maybe I’ll write the instructions better.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
natemcmastercommented, May 20, 2020

I would actually recommend using https://github.com/natemcmaster/LetsEncrypt#save-generated-certificates-and-account-information-to-a-directory instead of $HOME/.dotnet/corefx/cryptography/x509stores. Using the PersistDataToDirectory call will persists certificates AND your Let’s Encrypt account key, which allows you to renew your certificate weeks or months later when its close to expiring.

0reactions
stale[bot]commented, Jul 21, 2021

Closing because there was no response to the previous comment. If you are looking at this issue in the future and think it should be reopened, please make a comment and mention natemcmaster so he sees it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Use the Docker 1-Click Install on DigitalOcean
How To Use the Docker 1-Click Install on DigitalOcean · Step 1 — Creating a Docker Droplet · Step 2 — Accessing the...
Read more >
Digital Ocean example | Docker Documentation
Run docker -machine create with the digitalocean driver and pass your key to the --digitalocean-access-token flag, along with a name for the new...
Read more >
How do I deploy a docker app to DigitalOcean?
The simplest way is to use the DigitalOcean command line interface. You can use the following command to upload a Docker image to...
Read more >
Deploying to Digital Ocean
This tutorial describes how to deploy to DigitalOcean, which is a cloud hosting service that offers reasonable pricing, a clean and easy-to-use UI, ......
Read more >
Digital Ocean | Manual
Digital Ocean has its own private Container Registry, with which we can push and pull Docker images. In order to use this registry,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found