-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
5,078 additions
and
3,282 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,64 @@ | ||
# Etapa 1: Construção do ambiente Ruby (Jekyll) | ||
FROM jekyll/jekyll AS builder | ||
|
||
WORKDIR /build | ||
COPY Gemfile Gemfile.lock ./ | ||
RUN bundle install | ||
|
||
# Configuração do Bundler e instalação das dependências | ||
RUN bundle config set path './.bundle' && \ | ||
mkdir ./.bundle && \ | ||
chmod -R 777 /build/.bundle && \ | ||
bundle install | ||
|
||
# Etapa 2: Instalação do Node.js e pacotes npm | ||
FROM node:20 AS installer | ||
|
||
WORKDIR /build | ||
COPY package.json package-lock.json ./ | ||
RUN npm i | ||
|
||
# Instalação da versão mais recente do npm e das dependências | ||
RUN npm install -g npm@latest && \ | ||
npm install | ||
|
||
# Etapa 3: Construção do Jekyll e execução do Webpack | ||
FROM jekyll/jekyll AS builder2 | ||
|
||
WORKDIR /build | ||
|
||
# Copiar arquivos do 'builder' que contém o Jekyll instalado | ||
COPY --from=builder /build/.bundle ./ ./ | ||
|
||
# Copiar arquivos do 'installer' que contém as dependências do npm | ||
COPY --from=installer /build/node_modules ./node_modules/ | ||
|
||
# Copiar o restante dos arquivos (o código-fonte, por exemplo) | ||
COPY . . | ||
|
||
# Definir variáveis de ambiente necessárias para o Webpack | ||
# ENV NODE_OPTIONS=--openssl-legacy-provider | ||
|
||
# Executando o Webpack | ||
RUN npx webpack | ||
RUN mkdir ./_site | ||
RUN mkdir ./src/.jekyll-cache/ | ||
RUN chmod 777 ./src/.jekyll-cache/ | ||
RUN JEKYLL_ENV=production jekyll build --future --trace | ||
|
||
# Criação de diretórios e permissões para o Jekyll | ||
RUN mkdir ./_site && \ | ||
mkdir ./src/.jekyll-cache/ && \ | ||
chmod 777 ./src/.jekyll-cache/ | ||
|
||
# Construção do Jekyll para produção | ||
RUN JEKYLL_ENV=production jekyll build --future --trace | ||
|
||
# Etapa 4: Imagem final para execução com Nginx | ||
FROM nginx:alpine AS runner | ||
|
||
# Configuração do Nginx | ||
COPY deploy/nginx.conf /etc/nginx/nginx.conf | ||
|
||
WORKDIR /app | ||
COPY --from=builder /build/_site ./ | ||
|
||
# Copiar os arquivos gerados pelo Jekyll e as assinaturas | ||
COPY --from=builder2 /build/_site ./ | ||
COPY /assinaturas ./assinaturas | ||
|
||
# Expor a porta 5000 para o Nginx | ||
EXPOSE 5000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.