Skip to content

Build get stuck when ran from inside a Docker container #14523

@L0UARN

Description

@L0UARN

Describe the Bug

To reproduce the issue:

  1. Create a new astro project with npm create astro@latest and select the default options
  2. Add Tailwind CSS with npx astro add tailwind
  3. Import globals.css in Layout.astro (as intructed by the previous command)
  4. Create the following Dockerfile:
FROM node:lts-alpine AS build
COPY . .
RUN npm install
RUN npm run build

FROM nginx:alpine
COPY --from=build ./dist/* /var/www/website/html/
EXPOSE 80
CMD ["nginx"]
  1. Create the following compose.yaml:
services:
  website:
    build: .
    ports:
      - "80:80"
  1. Run docker compose up --build

What's the expected result?

The build completes

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-o3iokbxa?file=src%2Flayouts%2FLayout.astro

Participation

  • I am willing to submit a pull request for this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs triageIssue needs to be triaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions