use dockerfile
ci / build (push) Failing after 32s Details

This commit is contained in:
Chris Grimmett 2024-03-29 02:14:18 -08:00
parent 730e6a2a32
commit 54f519680e
5 changed files with 34 additions and 52 deletions

View File

@ -28,7 +28,7 @@ kubernetesVersion: v1.28.3
EOF EOF
endef endef
export script = $(value _script) export script = $(value _script)
cluster: minikube:
@ eval "$$script" @ eval "$$script"
minikube addons enable volumesnapshots minikube addons enable volumesnapshots
minikube addons enable csi-hostpath-driver minikube addons enable csi-hostpath-driver
@ -38,5 +38,8 @@ cluster:
# A gitea act runner which runs locally # A gitea act runner which runs locally
# https://docs.gitea.com/next/usage/actions/overview # https://docs.gitea.com/next/usage/actions/overview
runner: # this doesnt work because of missing docker in docker
docker run -d --rm -e GITEA_INSTANCE_URL=https://gitea.futureporn.net -e GITEA_RUNNER_REGISTRATION_TOKEN=${GITEA_RUNNER_REGISTRATION_TOKEN} -v /var/run/docker.sock:/var/run/docker.sock -v $$HOME/.local/share/applications/fp/act-runner-data:/data --privileged --name fp-gitea-act-runner gitea/act_runner # I'm running this using systemd instead
#runner:
# docker run -d --rm -e GITEA_INSTANCE_URL=https://gitea.futureporn.net -e GITEA_RUNNER_REGISTRATION_TOKEN=${GITEA_RUNNER_REGISTRATION_TOKEN} -v /var/run/docker.sock:/var/run/docker.sock -v $$HOME/.local/share/applications/fp/act-runner-data:/data --privileged --name fp-gitea-act-runner gitea/act_runner

View File

@ -20,7 +20,8 @@ docker_build(
## this is useful for changing the UI and seeing results ## this is useful for changing the UI and seeing results
docker_build( docker_build(
'fp/next', 'fp/next',
'./packages/next', '.',
dockerfile='next.dockerfile',
target='dev', target='dev',
live_update=[ live_update=[
sync('./packages/next', '/app') sync('./packages/next', '/app')
@ -30,7 +31,7 @@ docker_build(
## Uncomment the following for fp/next in production mode ## Uncomment the following for fp/next in production mode
## this is useful to test how fp/next will behave in production environment ## this is useful to test how fp/next will behave in production environment
## note: there is no live_update here. expect slow rebuilds in response to code changes ## note: there is no live_update here. expect slow rebuilds in response to code changes
# docker_build('fp/next', './packages/next') # docker_build('fp/next', '.', dockerfile='next.dockerfile')
k8s_resource( k8s_resource(
@ -54,18 +55,18 @@ k8s_resource(
port_forwards=['3000'], port_forwards=['3000'],
) )
k8s_resource( # k8s_resource(
workload='pgadmin-pod', # workload='pgadmin-pod',
port_forwards=['5050'] # port_forwards=['5050']
) # )
k8s_resource( # k8s_resource(
workload='strapi-pod', # workload='strapi-pod',
port_forwards=['1337'], # port_forwards=['1337'],
links=[ # links=[
link('http://localhost:1337/admin', 'Strapi Admin UI') # link('http://localhost:1337/admin', 'Strapi Admin UI')
] # ]
) # )
# v1alpha1.extension_repo(name='default', url='https://github.com/tilt-dev/tilt-extensions') # v1alpha1.extension_repo(name='default', url='https://github.com/tilt-dev/tilt-extensions')

13
link2cid.dockerfile Normal file
View File

@ -0,0 +1,13 @@
# Reference-- https://pnpm.io/docker
FROM node:20-alpine AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
WORKDIR /app
COPY ./packages/link2cid/package.json /app
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod
COPY ./packages/link2cid/index.js /app
ENTRYPOINT ["pnpm"]
CMD ["start"]

View File

@ -17,7 +17,7 @@ ENV NEXT_PUBLIC_UPPY_COMPANION_URL ${NEXT_PUBLIC_UPPY_COMPANION_URL}
ENV NEXT_TELEMETRY_DISABLED 1 ENV NEXT_TELEMETRY_DISABLED 1
COPY package.json pnpm-lock.yaml ./ COPY package.json pnpm-lock.yaml ./
RUN --mount=type=cache,id=pnpm-store,target=/pnpm/store pnpm install RUN --mount=type=cache,id=pnpm-store,target=/pnpm/store pnpm install
COPY . . COPY ./packages/next .
FROM deps AS dev FROM deps AS dev

View File

@ -1,35 +0,0 @@
## @greetz https://medium.com/@elifront/best-next-js-docker-compose-hot-reload-production-ready-docker-setup-28a9125ba1dc
FROM node:20-slim AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
RUN apt-get update && apt-get install -y -qq dumb-init
COPY . /app
WORKDIR /app
FROM base AS deps
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
FROM base AS taco
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
FROM deps AS build
ENV NEXT_TELEMETRY_DISABLED 1
RUN pnpm run -r build
FROM deps AS runner
ENV NEXT_TELEMETRY_DISABLED 1
WORKDIR /app
COPY --from=build /usr/src/app/public ./public
COPY --from=build /usr/src/app/.next/standalone ./
COPY --from=build /usr/src/app/.next/static ./.next/static
EXPOSE 3000
ENV HOSTNAME="0.0.0.0"
CMD [ "dumb-init", "node", "server.js" ]