Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent dist folders from static apps from being ignored #91

Open
lubien opened this issue May 1, 2024 · 1 comment
Open

Prevent dist folders from static apps from being ignored #91

lubien opened this issue May 1, 2024 · 1 comment

Comments

@lubien
Copy link
Contributor

lubien commented May 1, 2024

A friend had a dockerfile like this:

# syntax = docker/dockerfile:1

# Adjust NODE_VERSION as desired
ARG NODE_VERSION=18.7.0
FROM node:${NODE_VERSION}-slim as base

LABEL fly_launch_runtime="NodeJS"

# NodeJS app lives here
WORKDIR /app

# Set production environment
ENV NODE_ENV=production
ENV VITE_API_BASE_URL="https://japu-backoffice-dev.fly.dev/api/v1"
ARG YARN_VERSION=1.22.19
RUN npm install -g yarn@$YARN_VERSION --force
RUN npm install -g @quasar/cli


# Throw-away build stage to reduce size of final image
FROM base as build

# Install packages needed to build node modules
RUN apt-get update -qq && \
  apt-get install -y python-is-python3 pkg-config build-essential

# Install node modules
COPY --link package.json yarn.lock ./

COPY . .

RUN yarn install --production=false

RUN npx quasar build

FROM pierrezemb/gostatic

# Copy built application
COPY --from=build /app/dist/spa /srv/http

And they tried to deploy and got an issue like:

=> ERROR [2/2] COPY ./dist/spa/ /srv/http/                               0.0s 
------
[2/2] COPY ./dist/spa/ /srv/http/:
------

Because during launch they got asked to create a .dockerignore and accepted it. Probably it contained a line to ignore dist.

@rubys
Copy link
Contributor

rubys commented May 2, 2024

It looks like it is a general problem:

8	failed to fetch an image or build from source: error building: failed to solve: failed to compute cache key: failed to calculate checksum of ref xxxxxxxx "/yarn.lock": not found
4	failed to fetch an image or build from source: error building: failed to solve: failed to compute cache key: failed to calculate checksum of ref xxxxxxxx "/package-lock.json": not found
2	failed to fetch an image or build from source: error building: failed to solve: failed to compute cache key: failed to calculate checksum of ref xxxxxxxx "/app": not found
2	failed to fetch an image or build from source: error building: failed to solve: failed to compute cache key: failed to calculate checksum of ref xxxxxxxx "/pnpm-lock.yaml": not found
2	failed to fetch an image or build from source: error building: failed to solve: failed to compute cache key: failed to calculate checksum of ref xxxxxxxx "/prisma": not found
1	failed to fetch an image or build from source: error building: failed to solve: failed to compute cache key: failed to calculate checksum of ref xxxxxxxx "/.gitignore": not found
1	failed to fetch an image or build from source: error building: failed to solve: failed to compute cache key: failed to calculate checksum of ref xxxxxxxx "/apps/l192-notification": not found
1	failed to fetch an image or build from source: error building: failed to solve: failed to compute cache key: failed to calculate checksum of ref xxxxxxxx "/dist": not found
1	failed to fetch an image or build from source: error building: failed to solve: failed to compute cache key: failed to calculate checksum of ref xxxxxxxx "/frontend": not found

ignore looks like it could be useful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants