From 1635723035083adf4c851d36d54916230ada8761 Mon Sep 17 00:00:00 2001 From: Lizandro Guarnizo <77708265+lizandrogd@users.noreply.github.com> Date: Wed, 3 Jun 2026 22:10:28 -0500 Subject: [PATCH] add Dockerfiles and docker-compose for Coolify deploy --- admin/Dockerfile | 14 ++++++++++++++ admin/next.config.ts | 7 +++++++ backend/Dockerfile | 16 ++++++++++++++++ docker-compose.yml | 13 +++++++++++++ 4 files changed, 50 insertions(+) create mode 100644 admin/Dockerfile create mode 100644 admin/next.config.ts create mode 100644 backend/Dockerfile create mode 100644 docker-compose.yml diff --git a/admin/Dockerfile b/admin/Dockerfile new file mode 100644 index 0000000..a982eed --- /dev/null +++ b/admin/Dockerfile @@ -0,0 +1,14 @@ +FROM node:22-alpine AS builder +WORKDIR /app +COPY package*.json ./ +RUN npm ci --ignore-scripts +COPY . . +RUN npm run build + +FROM node:22-alpine AS runner +WORKDIR /app +COPY --from=builder /app/.next/standalone ./ +COPY --from=builder /app/.next/static ./.next/static +COPY --from=builder /app/public ./public +EXPOSE 3000 +CMD ["node", "server.js"] diff --git a/admin/next.config.ts b/admin/next.config.ts new file mode 100644 index 0000000..225e495 --- /dev/null +++ b/admin/next.config.ts @@ -0,0 +1,7 @@ +import type { NextConfig } from "next"; + +const nextConfig: NextConfig = { + output: 'standalone', +}; + +export default nextConfig; diff --git a/backend/Dockerfile b/backend/Dockerfile new file mode 100644 index 0000000..86c2b9f --- /dev/null +++ b/backend/Dockerfile @@ -0,0 +1,16 @@ +FROM node:22-alpine AS builder +WORKDIR /app +COPY package*.json ./ +RUN npm ci --ignore-scripts +COPY . . +RUN npx prisma generate +RUN npm run build + +FROM node:22-alpine AS runner +WORKDIR /app +COPY --from=builder /app/dist ./dist +COPY --from=builder /app/node_modules ./node_modules +COPY --from=builder /app/package.json ./ +COPY --from=builder /app/prisma ./prisma +EXPOSE 3000 +CMD ["node", "dist/main.js"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..5f7414e --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,13 @@ +services: + backend: + build: ./backend + ports: + - '3000:3000' + env_file: .env + + admin: + build: ./admin + ports: + - '5173:3000' + environment: + - NEXT_PUBLIC_API_URL=https://backend.prosapp.co/api/v1