docker-compose.yml
docker-compose.yml
file, you’ll notice that you must write a Dockerfile
for your appplication so that you can reference it in your compose file.
Just as you’d do when containerizing your app for any other circumstances, this Dockerfile
should package your application within a container image so that the application starts when you docker run
a container using that image.
Dockerfile
similar to the one below.
docker-compose.yml
, as shown below.
Dockerfile
for applications you own and for which there isn’t a built image yet.
Take it as a rule-of-thumb that you should not write Dockerfile
for applications such as databases, or message queues. For those applications, you should usually default to picking an image from Docker Hub, which is Docker’s official image repository.
We recommend that users only write Dockerfiles when they can’t find the software they need packed into a Docker Hub image.
REACT_APP_API_URL
build argument to set the environment variable REACT_APP_API_URL
. This variable will be used during npm run build
because it will go into the bundle so that the app knows what’s the backend to which it should send requests.
To provide a build argument containing service’s public address, you’ll use the dev.ergomake.preview.replace-arg.YOUR_ENV_VAR
label. Within that var, you can interpolate the address we’ll generate for a service, as shown in the example below.