Skip to content

Commit

Permalink
create development environment of zenn
Browse files Browse the repository at this point in the history
  • Loading branch information
Tocyuki committed Feb 23, 2021
0 parents commit 16b720f
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
@@ -0,0 +1,3 @@
node_modules
.DS_Store
.idea
20 changes: 20 additions & 0 deletions Makefile
@@ -0,0 +1,20 @@
.PHONY: $(shell egrep -o ^[a-zA-Z_-]+: $(MAKEFILE_LIST) | sed 's/://')

help: ## Print this help
@echo "Usage: make [target] (module=[terraform module name])"
@echo
@echo 'Targets:'
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)

init: ## exec docker-compose build & npx zenn init
@docker-compose build
@docker-compose run --rm npx zenn init

preview: ## exec npx zenn preview
@docker-compose up

article: ## exec npx zenn new:article
@docker-compose run --rm npx zenn new:article

book: ## exec npx zenn new:book
@docker-compose run --rm npx zenn new:book
4 changes: 4 additions & 0 deletions README.md
@@ -0,0 +1,4 @@
# Zenn Contents

* [📘 How to use](https://zenn.dev/zenn/articles/zenn-cli-guide)
* [📘 Markdown guide](https://zenn.dev/zenn/articles/markdown-guide)
Empty file added articles/.keep
Empty file.
Empty file added books/.keep
Empty file.
14 changes: 14 additions & 0 deletions docker-compose.yml
@@ -0,0 +1,14 @@
version: "3.8"

services:
npx:
build:
context: ./docker
dockerfile: Dockerfile
container_name: zenn
working_dir: /contents
volumes:
- ./:/contents
ports:
- "8000:8000"
command: npx zenn preview
10 changes: 10 additions & 0 deletions docker/Dockerfile
@@ -0,0 +1,10 @@
FROM node:15.3.0-alpine3.10

WORKDIR /contents
ENV LC_ALL=ja_JP.UTF-8

RUN apk update \
&& npm init --yes \
&& npm install -g zenn-cli@latest

ENTRYPOINT ["/usr/local/bin/npx"]

0 comments on commit 16b720f

Please sign in to comment.