GithubHelp home page GithubHelp logo

sample-dockerfile's Introduction

Get Started

This guide describes how to use DigitalOcean App Platform to run a sample Dockerfile application.

Note: Following these steps may result in charges for the use of DigitalOcean services.

Requirements

  • You need a DigitalOcean account. If you do not already have one, first sign up.

Deploy the App

Click the following button to deploy the app to App Platform. If you are not currently logged in with your DigitalOcean account, this button prompts you to to log in.

Deploy to DigitalOcean

Note that, for the purposes of this tutorial, this button deploys the app directly from DigitalOcean's GitHub repository, which disables automatic redeployment since you cannot change our template. If you want automatic redeployment or you want to change the sample app's code to your own, we instead recommend you fork our repository.

To fork our repository, click the Fork button in the top-right of its page on GitHub, then follow the on-screen instructions. To learn more about forking repos, see the GitHub documentation.

After forking the repo, you can view the same README in your own GitHub org; for example, in https://github.com/<your-org>/sample-dockerfile. To deploy the new repo, visit the control panel and click the Create App button. This takes you to the app creation page. Under Service Provider, select GitHub. Then, under Repository, select your newly-forked repo. Ensure that your branch is set to main and Autodeploy is checked on. Finally, click Next.

After clicking the Deploy to DigitalOcean button or completing the instructions above to fork the repo, follow these steps:

  1. Configure the app, such as by specifying HTTP routes, declaring environment variables, or adding a database. For the purposes of this tutorial, this step is optional.
  2. Provide a name for your app and select the region to deploy your app to, then click Next. By default, App Platform selects the region closest to you. Unless your app needs to interface with external services, your chosen region does not affect the app's performance, since to all App Platform apps are routed through a global CDN.
  3. On the following screen, leave all the fields as they are and click Next.
  4. Confirm your plan settings and how many containers you want to launch and click Launch Basic/Pro App.

After, you should see a "Building..." progress indicator. You can click View Logs to see more details of the build. It can take a few minutes for the build to finish, but you can follow the progress in the Deployments tab.

Once the build completes successfully, click the Live App link in the header and you should see your running application in a new tab, displaying the home page.

Make Changes to Your App

If you forked our repo, you can now make changes to your copy of the sample app. Pushing a new change to the forked repo automatically redeploys the app to App Platform with zero downtime.

Here's an example code change you can make for this app:

  1. Edit main.go and replace the "Hello!" greeting on line 31 with a different greeting
  2. Commit the change to the main branch. Normally it's a better practice to create a new branch for your change and then merge that branch to main after review, but for this demo you can commit to the main branch directly.
  3. Visit the control panel and navigate to your sample app.
  4. You should see a "Building..." progress indicator, just like when you first created the app.
  5. Once the build completes successfully, click the Live App link in the header and you should see your updated application running. You may need to force refresh the page in your browser (e.g. using Shift + Reload).

Learn More

To learn more about App Platform and how to manage and update your application, see our App Platform documentation.

Delete the App

When you no longer need this sample application running live, you can delete it by following these steps:

  1. Visit the Apps control panel.
  2. Navigate to the sample app.
  3. In the Settings tab, click Destroy.

Note: If you do not delete your app, charges for using DigitalOcean services will continue to accrue.

sample-dockerfile's People

Contributors

jgannondo avatar kamaln7 avatar keladhruv avatar moiesk avatar mrobst avatar sharmita3 avatar shivanikumar1 avatar ygabriel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sample-dockerfile's Issues

App from this sample building two web services

Using this sample, both from Choose Sample App or from my forked copy produces two apps. One seems to be the dockerized app, and the other seems to be a buildpack build of the go app. This seems erroneous

2023-03-17--1679068105_1216x797_scrot

.do directory

what's the difference between or need for the two files in the .do directory?

The readme doesn't mention them, there's no comments in the files in regards to what they do, and the docs you link to don't mention the files either.

How can my app connect to database in App Platform

My Database settings contains my API Service in the Trusted Sources list.
The App Spec contains all Database configuration and my API Service configuration contains the Database's env variables, and reference the Dockerfile path.
But, when the App Platform try to make a deploy and the process try to connect in database, the log emit the following error:

Error: connect ETIMEDOUT 1X.XXX.X.X:XXXXX
[2022-10-04 21:52:36] at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1159:16) {
[2022-10-04 21:52:36] errno: -110,
[2022-10-04 21:52:36] code: 'ETIMEDOUT',
[2022-10-04 21:52:36] syscall: 'connect',
[2022-10-04 21:52:36] address: '1X.XXX.X.X',
[2022-10-04 21:52:36] port: XXXXX
[2022-10-04 21:52:36] }

Button don't works

The repo you are trying to deploy does not contain a .do/deploy.template.yaml file. If you are the owner of the repo, please add an app spec in order to enable usage of our third-party app deployment feature. If you are not the owner, you must fork this repo to your own GitHub account in order to deploy it.

image

Not nearly enough detail in this example

  • how do you attach volumes?
  • how do you specify the source dir the docker build should take place in?
  • how do you specify a remote image on docker hub instead of building it from scratch on every deploy?
  • how do you specify the entrypoint and command?
  • how do you specify the ports to expose to the outside world? (especially if there are multiple ports)

Some of these things are alluded to in the docs, but this example repo has none of them, making users just have to figure it out via trial and error, which gets frustrating fast.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.