Application Setup
Dockerfile
The Dockerfile describes the steps you need to build and run your application.
FROMdefines the base image for your application.COPYmoves files from the local directory into the image.RUNexecutes a command.ENTRYPOINTdefines a command prefix that should be prepended to any command run on this image.CMDdefines the default command to start application.ARGallows you to specify build-time variables.
ARG
Convox respects the ARG Dockerfile directive, allowing you to specify build-time variables to be populated.
This is useful for creating dynamic build environments, allowing you to do things like:
- building differently in production and development environments
- specifying environment variables that should be used during a build, but should not be present in the Dockerfile itself or in the resulting image.
Warning: It is not recommended to use build-time variables for passing secrets. Build-time variable values are visible to any user of the image with the docker history command.
You can declare a build argument in the Dockerfile, with either a default value or an empty one:
ARG BUNDLE_WITHOUT="development:test"
ARG RAILS_ENV
You can send a value (or set an empty value, as below) to be applied during remote builds on your Rack by setting it with convox env:
$ convox env set BUNDLE_WITHOUT=none --promote
$ convox deploy