Created
January 19, 2019 07:02
-
-
Save masutaka/193483b54bfd4873c82c24a013a98740 to your computer and use it in GitHub Desktop.
masutaka.net on Heroku Docker
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
# (1) Perl の chalow コマンドで CHANGELOG メモを静的ファイルに変換 | |
FROM perl:5.28.0 AS chalow | |
RUN cpanm CGI HTML::Template | |
WORKDIR /work | |
COPY chalow/ chalow | |
COPY script/ script | |
COPY webroot/ webroot | |
RUN ./script/mkchalow | |
# (2) Honoka の css を取得 | |
FROM node:10.14.2-alpine AS honoka | |
RUN apk add --update --no-cache jq=1.6_rc1-r1 | |
WORKDIR /work | |
COPY package.json . | |
COPY package-lock.json . | |
RUN npm install | |
RUN HONOKA_VERSION=$(jq -r '.dependencies."bootstrap-honoka".version' < package-lock.json) && \ | |
mkdir -p "webroot/honoka/${HONOKA_VERSION}/css" && \ | |
cp node_modules/bootstrap-honoka/dist/css/bootstrap.min.css "webroot/honoka/${HONOKA_VERSION}/css" | |
# (3) (1) と (2) のビルド生成物を nginx コンテナにコピー | |
FROM nginx:1.15.7-alpine | |
COPY --from=chalow /work/webroot /usr/share/nginx/html | |
COPY --from=honoka /work/webroot/honoka /usr/share/nginx/html/honoka | |
CMD sed -i -e "s/^\( \+listen \+\)80;/\1$PORT;/" /etc/nginx/conf.d/default.conf && \ | |
nginx -g "daemon off;" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment