Host Code on a Server

Host Code on a Server

JakeEh

54 года назад

579 Просмотров

In this video I go over how you can host any code on a server for cheap - but not free. We host a Discord bot on Digital ocean!

This was the first video I didn't edit myself. If you enjoyed the editing, please let me know in the comments :)

Droplet provider: https://digitalocean.com
Discord: https://discord.gg/AeZrfR9Hpg

Thanks for watching! ❤️

Code Links:

Discord Bot: https://github.com/Jalsemgeest/Python/blob/main/DiscordBot/main.py

Docker File:
FROM ubuntu:latest

FROM python:3.10

WORKDIR /bot
COPY requirements.txt /bot/
RUN pip install -r requirements.txt

COPY . /bot
CMD ["python", "-u", "main.py"]

For each command below, "$:" should not be included. I added it here to indicate the start of a command.

Server commands:
$: sudo apt update - updates your server
$: sudo apt -y upgrade - upgrades your server
$: sudo apt install -y python3-pip - installs python3 with pip

Server Docker commands:
$: sudo apt install apt-transport-https ca-certificates curl software-properties-common
$: curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
$: sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
$: apt-cache policy docker-ce
$: sudo apt install docker-ce
$: sudo systemctl status docker

Docker commands:
$: docker build -t bot .
$: docker images
$: docker run --name bot -d bot
$: docker ps
$: docker logs bot


Timestamps:
00:00 Intro
00:41 The Code
00:52 The Server
4:30 The Container
8:20 Containerizing Our Bot
10:20 Example
10:42 Outro

#coding #server #docker

Тэги:

#discord_bot #web_hosting #code_server_tutorial #server_tutorial #simple_docker #docker #container #docker_container #jakeeh #digitalocean #digital_ocean
Ссылки и html тэги не поддерживаются


Комментарии: