Giter Site home page Giter Site logo

docker-nginx-vapor's Introduction

操作

apt update 

apt install -y git

# docker install
apt  install -y docker.io
curl -L "https://github.com/docker/compose/releases/download/1.26.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose

# 仮想メモリ拡張
fallocate -l 6G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile # swap有効化
cp /etc/fstab /etc/fstab.bak # backup
echo '/swapfile none swap sw 0 0' | tee -a /etc/fstab # swap永続化

# Nginx
apt install -y nginx
systemctl start nginx
unlink /etc/nginx/sites-available/default
unlink /etc/nginx/sites-enabled/default
echo "
server {
    server_name hello.com;
    listen 80;

    location / {
        proxy_pass http://127.0.0.1:8080;
        proxy_pass_header Server;
        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_pass_header Server;
        proxy_connect_timeout 3s;
        proxy_read_timeout 10s;
    }
}
" > /etc/nginx/sites-enabled/conf
systemctl restart nginx

# Firewall
ufw enable # yが必要
ufw allow 'Nginx HTTP'

# git clone & build & up
git clone https://github.com/NITNCtanakaShoki/docker-nginx-vapor.git
docker-compose build
docker-compose up -d
docker-compose run migrate

docker-nginx-vapor's People

Contributors

nitnctanakashoki avatar lemo-nade-room avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.