mirror of
https://github.com/lucasrcsantana/story-generator.git
synced 2025-12-16 13:27:52 +00:00
- Implementa Dockerfile com multi-stage build - Configura pipeline no Gitea Actions - Adiciona integração com Redis - Implementa healthchecks - Configura registry no Gitea minor: novas funcionalidades de infraestrutura
40 lines
774 B
Docker
40 lines
774 B
Docker
# Build stage
|
|
FROM node:18-alpine AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
# Adicionar dependência do Redis
|
|
RUN apk add --no-cache redis
|
|
|
|
# Copiar arquivos de dependências
|
|
COPY package*.json ./
|
|
COPY yarn.lock ./
|
|
|
|
# Instalar dependências
|
|
RUN yarn install --frozen-lockfile
|
|
|
|
# Copiar código fonte
|
|
COPY . .
|
|
|
|
# Build da aplicação
|
|
RUN yarn build
|
|
|
|
# Production stage
|
|
FROM node:18-alpine AS runner
|
|
|
|
WORKDIR /app
|
|
|
|
# Adicionar dependência do Redis
|
|
RUN apk add --no-cache redis
|
|
|
|
# Copiar arquivos necessários do builder
|
|
COPY --from=builder /app/next.config.js ./
|
|
COPY --from=builder /app/public ./public
|
|
COPY --from=builder /app/.next/standalone ./
|
|
COPY --from=builder /app/.next/static ./.next/static
|
|
|
|
# Expor porta
|
|
EXPOSE 3000
|
|
|
|
# Comando para rodar a aplicação
|
|
CMD ["node", "server.js"] |