Skip to content

Specifics of multi-stage builds in app.yml #43

Answered by 1800joe
nprimmer asked this question in Questions
Discussion options

You must be logged in to vote

I spoke too soon. We do support multi-stage builds. See the following example:

The copy step referencing main refers to the original build image.

 - name: WebsiteStatic
    type: service
    image: node:18-alpine
    root: website-static/
    build:
      steps:
        - directory: /website-static
        - copy: package*.json
          destination: ./
        - run: npm ci
        - copy: index.html
        - copy: vite.config.js
        - copy: public/
        - copy: src/
        - run: npm run build
        - image: nginx:1-alpine
          stage: nginx
        - copy: website-static/dist
          destination: /usr/share/nginx/html/
          from: main
        - copy: nginx.conf
  …

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by 1800joe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants