npx create-ship-app init
in the terminal then choose desired build type and Digital Ocean Apps as a cloud service provider.
connect
button.
Connect your application
option. Choose driver and mongo version, and copy connection string. Don’t forget to replace <password>
with your credentials.
Let's start free
to finish database creation.
redis://:<password@<public-endpoint>
. Save this value. It will be needed later when creating the app in Digital Ocean.
APP_ENV
environment variable is typically set based on the environment in which the application is running.
Its value corresponds to the specific environment, such as “development”, “staging” or “production”.
This variable helps the application identify its current environment and load the corresponding configuration.
For the web application, by setting the environment variable APP_ENV
,
the application can determine the environment in which it is running and download the appropriate configuration file:
APP_ENV | File |
---|---|
development | .env.development |
staging | .env.staging |
production | .env.production |
.env
file that houses its environment-specific configuration.
This file typically contains variables like API keys, secrets, or other sensitive information.
To ensure security, it’s crucial to add the .env
file to the .gitignore
file,
preventing it from being tracked and committed to the repository.
So just specify the environment variables that will contain the values of your secrets.
For example, if you have a secret named API_KEY
,
create an environment variable named API_KEY
and set the value of the corresponding secret for it.
/deploy
directory at the root of your project and proceed to the next steps:
Pulumi CLI
Pulumi Login
DigitalOcean Tokens and Keys
Configuring Tokens and Keys
.zshrc
or .bashrc
First you’ll need to enter the .zshrc
or .bashrc
file in editing mode:GitHub apps
Stack initialization
{project-name}
with the actual name of your project and make sure to update it in Pulumi.yaml
file. {environment}
with the desired environment: staging
or production
values are allowed.App environments
.env.example
file to create a new environment-specific file using the command:Installing dependencies
Resources creating
Settings
tab.
Navigate to Domains
row to open domain settings and copy starter domain of application.
DNS
tab and create a new record.Add record
. Select type CNAME
, enter domain name (must be the same you entered in digital ocean settings) and paste alias into target
field.
Make sure Proxy status
toggle enabled..github/workflows
folder, responsible for triggering deployment when you push changes in your repository. If you chose frontend or backend on the initialization step, you’ll have one github workflow for the selected application type.
These actions require a Digital Ocean Personal Access Token and application ID.
Respectively these are DO_ACCESS_TOKEN
and DO_API_STAGING_APP_ID
/DO_WEB_STAGING_APP_ID
/DO_API_PRODUCTION_APP_ID
/DO_WEB_PRODUCTION_APP_ID
.
Next, navigate to the Apps tab in the left sidebar and open your Digital Ocean application. You can find the id of your application id in the browser address bar.