Skip to content
This repository has been archived by the owner on Mar 22, 2023. It is now read-only.

lucetre/xyz

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker build

  1. Dockerfile
FROM node:14.19.0

RUN mkdir -p /app
WORKDIR /app
ADD . /app/

RUN rm yarn.lock || true
RUN rm package-lock.json || true
RUN yarn
RUN yarn build

ENV HOST 0.0.0.0
EXPOSE 3000

CMD [ "yarn", "start"]
  1. .dockerignore
node_modules/
dist/
  1. docker build --tag lucetre.xyz:0.0.1 .
  2. docker run --name lucetre.xyz -d -p 3000:3000 lucetre.xyz:0.0.1

Connect ec2 instance

  1. chmod 400 lucetre.pem
  2. ssh -i "lucetre.pem" ec2-user@ec2-3-39-237-30.ap-northeast-2.compute.amazonaws.com

Install docker

  1. https://docs.aws.amazon.com/ko_kr/AmazonECS/latest/developerguide/create-container-image.html

Create self-hosted runner

  1. Follow the linux guidelines.
  2. Enter any additional labels: label-go
  3. [ec2] nohup ./run.sh &
  4. [ec2] tail -f nohup.out

Register DNS record

  1. @ IP_ADDR
  2. www IP_ADDR
  3. https://dnschecker.org/#A/lucetre.xyz
  4. http://lucetre.xyz/
  5. ssh -i "lucetre.pem" ec2-user@lucetre.xyz

Http 2 Https

Install nginx @ ec2

  1. amazon-linux-extras list | grep nginx
  2. sudo amazon-linux-extras install -y nginx1
  3. nginx -v
  4. sudo systemctl start nginx
  5. vim /etc/nginx/conf.d/your-site.conf
    server {
        listen 80;
        server_name nextjs.your-site.com;
    location / {
            proxy_pass http://127.0.0.1:3000;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
        }
    }
    
  6. sudo systemctl restart nginx

Certbot

  1. sudo yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
  2. sudo yum-config-manager --enable epel*
  3. sudo yum install certbot python2-certbot-nginx -y
  4. sudo certbot --nginx
  5. crontab -e
    • 0 12 * * * /usr/bin/certbot renew --quiet

ec2 Restart

  1. cd actions-runner
  2. nohup ./run.sh &
  3. tail -f nohup.out
  4. sudo systemctl start nginx
  5. sudo certbot --nginx

Reference

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 84.9%
  • Jupyter Notebook 9.1%
  • CSS 4.0%
  • Dockerfile 1.6%
  • Other 0.4%