From acf6719ad2e6b494d5fcf3b876f44bb5c8e28828 Mon Sep 17 00:00:00 2001 From: Yasuaki Uechi Date: Tue, 8 Jun 2021 17:30:30 +0900 Subject: [PATCH] fix dockerfile --- .github/workflows/docker.yml | 24 ------------------------ Dockerfile | 19 ++++++++++++++++--- 2 files changed, 16 insertions(+), 27 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 30b63a0..407b9b6 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -19,30 +19,6 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 - - name: Set up Pandoc - run: | - sudo apt-get update - sudo apt-get install pandoc -y - - - name: Use Node.js 15.x - uses: actions/setup-node@v1 - with: - node-version: "15.x" - - - name: Cache NPM dependencies - uses: actions/cache@v2 - with: - path: node_modules - key: ${{ runner.OS }}-npm-cache - restore-keys: | - ${{ runner.OS }}-npm-cache - - - name: Install Dependencies - run: npm install - - - name: Build - run: npm run build - - name: Login to GitHub Container Registry uses: docker/login-action@v1 with: diff --git a/Dockerfile b/Dockerfile index 70b4195..badeb25 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,18 @@ -FROM nginx:stable-alpine +FROM node:15 as build + +# https://github.com/jgm/pandoc/releases +RUN curl -LO https://github.com/jgm/pandoc/releases/download/2.14.0.1/pandoc-2.14.0.1-1-amd64.deb +RUN dpkg -i pandoc-2.14.0.1-1-amd64.deb + +WORKDIR /app +COPY package.json /app +RUN yarn install +COPY themes /app/themes +COPY source /app/source +COPY _config.yml /app/ +RUN yarn build + +FROM nginx:stable-alpine as runtime COPY nginx.conf /etc/nginx/nginx.conf - -COPY public /var/www/html/ \ No newline at end of file +COPY --from=build /app/public /var/www/html/ \ No newline at end of file