By Aplato
I’m trying to create a new project using DigitalOcean’s App Platform with a monorepo. I’m loosely following this guide on how to structure the project, but I’m not sure how to target a particular build step within DigitalOcean.
This is the Docker command:
docker build . --target app1 --tag app1:latest
This is how I would target it in docker compose:
version: '3.8'
services:
web:
container_name: sample-app1
image: sample-app1
build:
context: .
target: app1
ports:
- '3000:3000'
Is there a way I can configure this using the App Platform?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Accepted Answer
Hey @aplato,
I believe that this is not available as an app spec argument yet:
https://docs.digitalocean.com/products/app-platform/reference/app-spec/
The best thing to do to get your voice heard regarding this would be to head over to our Product Ideas board and post a new idea, including as much information as possible for what you’d like to see implemented.
For the time being, since the docker_build_target
attribute is not supported yet, you would need to structure your Dockerfile to have the desired target stage as the last stage in the Dockerfile when using the App Platform. That way, the App Platform builds the final image based on the last stage of your Dockerfile by default.
Alternatively, you can build your Docker images externally (using GitHub Actions, GitLab CI/CD, or another CI/CD tool), push the images to a container registry (like Docker Hub or DigitalOcean Container Registry), and then deploy the pre-built images to the App Platform.
Hope that helps!
- Bobby.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.