LoginSignup
1
0

More than 3 years have passed since last update.

AWS Copilot でnginxを動かしてみる。

Posted at

前提

  • 環境
    • Mac OS
    • AWS CLIを使うことができる
    • Dockerがインストールされている。

Copilot のインストール

curl -Lo /usr/local/bin/copilot https://github.com/aws/copilot-cli/releases/download/v0.1.0/copilot-darwin-v0.1.0 && \
  chmod +x /usr/local/bin/copilot && \
  copilot --help

Dockerfileを用意

mkdir copilot
cd copilot

copilotディレクトリの中に下記のDockerfileを作成します。

FROM nginx:alpine
EXPOSE 80
COPY . /usr/share/nginx/html

copilot init

copilot init

CLI上でいくつか質問されるので下記を入力・選択しました。

Application name: nginx-test
Service type: Load Balanced Web Service
Service name: nginx
Dockerfile: ./Dockerfile

確認

ブラウザ

先ほどのcopilot initの実行結果、最終行にURLが記載されています。
ここにアクセスします。

✔ Deployed nginx, you can access it at http://nginx-Publi-64I230BK4R******5852852.ap-northeast-1.elb.amazonaws.com.

image.png

AWS ECS

FARGATEで先ほどのnginxが実行されています。

image.png

image.png

参考

公式:
https://aws.amazon.com/jp/blogs/news/introducing-aws-copilot/

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0