fix: include API/ in backend Docker image
Build & Push Docker Images / test-backend (push) Successful in 49s
Build & Push Docker Images / test-frontend (push) Successful in 58s
Build & Push Docker Images / build-backend (push) Failing after 1m7s
Build & Push Docker Images / build-frontend (push) Successful in 1m13s

Build context was ./backend so API/ was never copied into the image.
server.js imports ../API/index.js which resolves to /API/index.js at runtime.
Expand build context to project root and explicitly copy API/ to /API/.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Antoni Nuñez Romeu
2026-05-25 16:09:06 +02:00
parent 3dc2c4c9f2
commit 34733c121c
2 changed files with 6 additions and 3 deletions
+3 -2
View File
@@ -1,8 +1,9 @@
FROM node:18-alpine FROM node:18-alpine
WORKDIR /app WORKDIR /app
COPY package*.json ./ COPY backend/package*.json ./
RUN npm ci --omit=dev RUN npm ci --omit=dev
COPY . . COPY backend/ .
COPY API/ /API/
RUN mkdir -p /app/data RUN mkdir -p /app/data
EXPOSE 3001 EXPOSE 3001
CMD ["node", "server.js"] CMD ["node", "server.js"]
+3 -1
View File
@@ -5,7 +5,9 @@ services:
backend: backend:
image: git.hacecalor.net/ichitux/farmafinder-backend:latest image: git.hacecalor.net/ichitux/farmafinder-backend:latest
build: ./backend build:
context: .
dockerfile: backend/Dockerfile
restart: unless-stopped restart: unless-stopped
ports: ports:
- "3001:3001" - "3001:3001"