Add Dockerfile, docker-compose.yml, and coolify.json for deployment
SPA pattern: node build → nginx serve on port 3000, exposed via HOST_PORT. Deploys to box-repoapps as spike-breakdown on port 2011, domain spikes.dotrepo.com. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
14
Dockerfile
Normal file
14
Dockerfile
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
FROM node:22-alpine AS build
|
||||||
|
WORKDIR /app
|
||||||
|
COPY package.json package-lock.json ./
|
||||||
|
RUN npm ci
|
||||||
|
COPY . .
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
|
FROM nginx:alpine
|
||||||
|
RUN sed -i 's/listen\s*80;/listen 3000;/g' /etc/nginx/conf.d/default.conf
|
||||||
|
RUN sed -i '/location \/ {/a\ try_files $uri $uri/ /index.html;' /etc/nginx/conf.d/default.conf
|
||||||
|
COPY --from=build /app/dist /usr/share/nginx/html
|
||||||
|
EXPOSE 3000
|
||||||
|
HEALTHCHECK --interval=60s --timeout=10s --retries=3 \
|
||||||
|
CMD wget -qO- http://localhost:3000/ || exit 1
|
||||||
9
coolify.json
Normal file
9
coolify.json
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"name": "spike-breakdown",
|
||||||
|
"buildpack": "dockercompose",
|
||||||
|
"branch": "master",
|
||||||
|
"port": 2011,
|
||||||
|
"domain": "spikes.dotrepo.com",
|
||||||
|
"server": "box-repoapps",
|
||||||
|
"repo": "idea.llm.spike.breakdown"
|
||||||
|
}
|
||||||
13
docker-compose.yml
Normal file
13
docker-compose.yml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
services:
|
||||||
|
spike-breakdown:
|
||||||
|
build: .
|
||||||
|
image: spike-breakdown:latest
|
||||||
|
container_name: spike-breakdown
|
||||||
|
restart: unless-stopped
|
||||||
|
ports:
|
||||||
|
- "${HOST_PORT:-3000}:3000"
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "wget", "-qO-", "http://localhost:3000/"]
|
||||||
|
interval: 60s
|
||||||
|
timeout: 10s
|
||||||
|
retries: 3
|
||||||
Reference in New Issue
Block a user