def _start(env): click.echo('Starting services...') run('mkdir -p %s' % env['DB_BACKUP_MOUNT']) with cd(BASE_DIR): run( 'docker-compose up -d --remove-orphans', capture_output=False, env=env, ) root_url = _root_url(env) click.echo( '\nDone. It may take a few moments for the app to come online at:\n' ' -> %s\n\n' 'If it isn\'t available immediately, please check again after ' 'a minute or two. If you experience any problems with the ' 'installation, please check the Troubleshooting guide:\n' ' -> https://github.com/teamplify/teamplify-runner/#troubleshooting' '' % root_url, ) if env['WEB_HOST'].lower() == 'localhost': click.echo( '\nWARNING: you\'re running Teamplify on localhost. This is ' 'probably OK if you only need to run a demo on your local machine. ' 'However, in this mode it will not be available to anyone from the ' 'network. If you\'d like to make it available on the network, you ' 'need to provide a publicly visible domain name that points to ' 'this server.', )
def _running(env): with cd(BASE_DIR): output = run( 'docker-compose ps -q app', suppress_output=True, env=env, ).stdout_lines return bool(output)
def _stop(env): click.echo('Stopping services...') with cd(BASE_DIR): run( 'docker-compose rm -v --stop --force', capture_output=False, env=env, )