feat: Docker bidez altxatzea ahalbidetzen du
This commit is contained in:
29
Dockerfile
Normal file
29
Dockerfile
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
# 1.- Builder
|
||||||
|
FROM node:24.19.0-alpine AS builder
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY package.json package-lock.json astro.config.mjs tsconfig.json ./
|
||||||
|
COPY src ./src
|
||||||
|
COPY public ./public
|
||||||
|
|
||||||
|
# RUN npm install -g npm@12.0.2
|
||||||
|
RUN npm install
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
|
# 2.- Runtime
|
||||||
|
FROM node:24.19.0-alpine AS runner
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Only copy necessary files
|
||||||
|
COPY --from=builder /app/dist ./dist
|
||||||
|
COPY --from=builder /app/node_modules ./node_modules
|
||||||
|
|
||||||
|
RUN addgroup -g 1001 -S nodejs
|
||||||
|
RUN adduser -S nodejs -u 1001
|
||||||
|
USER nodejs
|
||||||
|
|
||||||
|
EXPOSE 4321
|
||||||
|
|
||||||
|
CMD ["node", "dist/server/entry.mjs"]
|
||||||
@@ -9,7 +9,9 @@ import node from "@astrojs/node";
|
|||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
integrations: [react()],
|
integrations: [react()],
|
||||||
output: "server",
|
output: "server",
|
||||||
|
server: {
|
||||||
|
host: "0.0.0.0",
|
||||||
|
},
|
||||||
adapter: node({
|
adapter: node({
|
||||||
mode: "standalone",
|
mode: "standalone",
|
||||||
}),
|
}),
|
||||||
|
|||||||
12
docker-compose.yml
Normal file
12
docker-compose.yml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
services:
|
||||||
|
yt2rss:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
container_name: yt2rss
|
||||||
|
ports:
|
||||||
|
- "4321:4321"
|
||||||
|
environment:
|
||||||
|
NODE_ENV: production
|
||||||
|
HOST: "0.0.0.0"
|
||||||
|
PORT: "4321"
|
||||||
|
restart: unless-stopped
|
||||||
Reference in New Issue
Block a user