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!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Sign up for Infrastructure as a Newsletter.
Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Hey @aplato,
I believe that this is not available as an app spec argument yet:
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.