Dockerfile
※ 下記のファイルだけではdokerは起動しません。nginxの設定ファイルをコピーする処理をしているため
FROM amazonlinux:latest RUN yum update -y ## nginx RUN yum install -y amazon-linux-extras RUN amazon-linux-extras install nginx1 RUN systemctl enable nginx COPY ./nginx.conf /etc/nginx/ ## nodejs RUN curl -sL https://rpm.nodesource.com/setup_14.x | bash - RUN yum install nodejs -y RUN yum -y install wget RUN wget https://dl.yarnpkg.com/rpm/yarn.repo -O /etc/yum.repos.d/yarn.repo RUN yum -y install yarn ## gatsby cli RUN yarn global add gatsby-cli WORKDIR /srv/frontend/app
gatsbyインストール
yarn global add gatsby-cli
プロジェクトの作成
gatsby new <プロジェクト名>
※ gitがインストールされていないとエラーになる
info Creating new site from git: https://github.com/gatsbyjs/gatsby-starter-default.git ERROR Command failed with ENOENT: git clone https://github.com/gatsbyjs/gatsby-starter-default.git hoge --recursive --depth=1 spawn git ENOENT Error: Command failed with ENOENT: git clone https://github.com/gatsbyjs/gatsby-starter-default.git hoge --recursive --depth=1 spawn git ENOENT
サーバーの起動
- サーバー起動
# gatsby develop
http://localhost:8000/___graphql
にアクセスするとgraphqlが利用できることが確認できる