Just wondering what the working_dir file really does for an image being loaded via docker-compose. A sample docker-compose.yml file as follows:
dev: extends: file: common.yml service: workspace volumes: - $ATOMSPACE_SOURCE_DIR:/atomspace - $COGUTILS_SOURCE_DIR:/cogutils # Uncomment the following lines if you want to work on moses # - $MOSES_SOURCE_DIR:/moses working_dir: /opencog # This is the same as the volume mount point below links: - postgres:db - relex:relex postgres: image: opencog/postgres # Uncomment the following lines if you want to work on a production # system. # NOTE: The environment variable `PROD` is set `True` then the entrypoint # script in opencog/postgres does additional configurations. # environment: # - PROD=True relex: image: opencog/relex command: /bin/sh -c "./opencog-server.sh"
depends_on is a Docker Compose keyword to set the order in which services must start and stop. For example, suppose we want our web application, which we'll build as a web-app image, to start after our Postgres container.
The Compose file is a YAML file defining services, networks and volumes. The default path for a Compose file is ./docker-compose.yml . Tip: You can use either a .yml or .yaml extension for this file. They both work.
Validating your file now is as simple as docker-compose -f docker-compose. yml config . As always, you can omit the -f docker-compose. yml part when running this in the same folder as the file itself or having the COMPOSE_FILE environment variable pointing to your file.
If you look over the Docker documentation, it describes an EntryPoint as: An ENTRYPOINT allows you to configure a container that will run as an executable.
working_dir
sets the working directory of the container that is created. It is the same as the --workdir
flag to docker run
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With