首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何创建正确的.lando.yml自定义文件?

问如何创建正确的.lando.yml自定义文件?
EN

Stack Overflow用户
提问于 2018-07-24 14:05:52
回答 1查看 2.8K关注 0票数 0

有没有办法创建一个正确的、真正定制的.lando.yml文件,这样它就不会使用任何菜谱了?如何在Lando中指定“给我Apache、MariaDB、PHP”?

我试过这个

代码语言:javascript
复制
    # The name of the app
    name: mariadb

    # Give me http://mariadb.lndo.site and https://mariadb.lndo.site
    proxy:
      html:
        - mariadb.lndo.site

    # Set up my services
   services:

  # Set up a basic webserver running the latest nginx with ssl turned on
  html:
    type: nginx
    ssl: true
    webroot: www

  # Spin up a mariadb container called "database"
  # NOTE: "database" is arbitrary, you could just as well call this "db" or "kanye"
  database:

    # Use mariadb version 10.1
    type: mariadb:10.1

    # Optionally allow access to the database at localhost:3307
    # You will need to make sure port 3307 is open on your machine
    #
    # You can also set `portforward: true` to have Lando dynamically assign
    # a port. Unlike specifying an actual port setting this to true will give you
    # a different port every time you restart your app
    portforward: 3307

    # Optionally set the default db credentials
    #
    # Note: You will need to `lando destroy && lando start` to change these if you've
    # already started your app
    # See: https://docs.devwithlando.io/tutorials/lando-info.html
    creds:
      user: mariadb
      password: mariadb
      database: mariadb

    # Optionally load in all the mariadb config files in the config directory
    # This is relative to the app root
    # NOTE: these files need to end in .cnf
    config:
      confd: config

但是在lando start之后,我得到了一个ERROR: No such service: appserver错误,这方面的文档非常混乱。

谢谢。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-11-01 19:13:12

您将需要查看lando自定义项目页面的构建自定义堆栈部分。

我不会做您的整个项目,但基本内容如下:

代码语言:javascript
复制
# LAMP stack example
name: lamp

proxy:
  appserver:
    - lamp.lndo.site  # Allows you to access the site at http[s]://lamp.lndo.site
                      # This may actually get done automatically

services: # Define your services
  appserver:  # Create a web server container
    type: php:5.3 # Specify what version of php to use
    via: apache   # This could be nginx, should you choose so
    webroot: www  # Specify webroot
    config:  # If you want to add/edit
      server: config/apache/lamp.conf  # Use an alternate apache config file
      conf: path/from/app/root/php.ini # Alter php configuration with a custom file
  database:  # Create a database server container
    type: mysql
    portforward: 3308
    creds:  # Specify what creds/db to use
      user: lamp
      password: lamp
      database: lamp

tooling:  # These toolings allow you to connect land <command> to the appropriate containers
  composer: # Call with "lando composer..."
    service: appserver
    description: Run composer commands
    cmd: composer --ansi
  php:      # Call with "lando php..."
    service: appserver
  mysql:    # Call with "lando mysql..."
    user: root
    service: database
    description: Drop into a MySQL shell
票数 8
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51500712

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档