diff --git a/dockerfile b/dockerfile index 5491e69..700a1ea 100644 --- a/dockerfile +++ b/dockerfile @@ -1,13 +1,6 @@ -# Autenticação com Gitea +# Build stage FROM node:18-alpine AS builder -# Argumentos para autenticação -ARG DOCKER_REGISTRY_USER -ARG DOCKER_REGISTRY_PASSWORD - -# Login no registro -RUN echo "${DOCKER_REGISTRY_PASSWORD}" | docker login gitea.tamfrr.com -u ${DOCKER_REGISTRY_USER} --password-stdin - WORKDIR /app # Copiar arquivos de configuração @@ -21,7 +14,7 @@ RUN npx prisma generate # Build da aplicação RUN npm run build -# Imagem final +# Production stage FROM node:18-alpine WORKDIR /app @@ -33,6 +26,10 @@ COPY --from=builder /app/package*.json ./ COPY --from=builder /app/public ./public COPY --from=builder /app/prisma ./prisma +# Variáveis de ambiente +ENV NODE_ENV=production +ENV PORT=3000 + EXPOSE 3000 CMD ["npm", "start"] \ No newline at end of file