Atualizar dockerfile

This commit is contained in:
2024-11-24 09:42:57 -08:00
parent 1b580667f9
commit 230a5ff48d

View File

@ -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"]