์์ ์ dev.to ๐ณ ์๋ฒ๋ฅผ ์์ํ์ธ์ - ๋จ์ผ ๋ช ๋ น์ผ๋ก (๊ฑฐ์)!
๋ฆฌํฌ์งํ ๋ฆฌ๋ฅผ ๋ณต์ ํ๊ณ bash ์คํฌ๋ฆฝํธ๋ฅผ ์คํํ ๋ค์ ํ๋ฉด์ ์ง์นจ์ ๋ฐ๋ฆ ๋๋ค.
git clone https://github.com/uilicious/dev.to-docker.git && \
cd dev.to-docker && sudo ./docker-run.sh INTERACTIVE-DEMO
๋ ๊ธด ๋์ปค ๊ธฐ๋ฐ ๋ช
๋ น(git clone ์์)
์ฐธ๊ณ : ๋ค์ํ<values>
์ ๋ชจ๋ ๊ต์ฒดํด์ผ ํฉ๋๋ค.
# Run a postgres server configured for dev.to
docker run -d --name dev-to-postgres \
-e POSTGRES_PASSWORD=devto \
-e POSTGRES_USER=devto \
-e POSTGRES_DB=PracticalDeveloper_development \
-v "<POSTGRES_DATA>:/var/lib/postgresql/data" \
postgres:10.7-alpine;
# Wait about 30 seconds, to give the postgres container time to start
sleep 30
#
# Run the prebuilt dev.to container
# binded to localhost:3000
#
# Algoliasearch API key is required for dev.to,
# for login do consider adding github/twitter keys as well
# see : https://github.com/thepracticaldev/dev.to/blob/master/config/sample_application.yml
#
docker run -d -p 3000:3000 \
--name dev-to-app \
--link dev-to-postgres:db \
-v "<DEVTO_UPLOAD_DIR>:/usr/src/app/public/uploads/" \
-e ALGOLIASEARCH_APPLICATION_ID=<APP_ID> \
-e ALGOLIASEARCH_SEARCH_ONLY_KEY=<SEARH_KEY> \
-e ALGOLIASEARCH_API_KEY=<ADMIN_KEY> \
uilicious/dev.to
#
# Also : do give 5~10 minutes for the server to be up.
# It does take a long time to setup and start
#
Docker ํ๋ธ ๋งํฌ:
Btw: ์ ๋ฐฐํฌ์์ ์์ฑ๋ ๋ค์ํ ๋ฌด์์ ๊ธฐ์ฌ ์ ๋ชฉ์ด ๋งค์ฐ ์ฌ๋ฏธ์์ต๋๋ค.
PicoCreator
์ ๊ฒ์๋จ
์ด๊ฒ์ ์ด๋ค ์ ํ์ PR์
๋๊น? (ํด๋น๋๋ ํญ๋ชฉ ๋ชจ๋ ์ฒดํฌ)
# Run a postgres server configured for dev.to
docker run -d --name dev-to-postgres \
-e POSTGRES_PASSWORD=devto \
-e POSTGRES_USER=devto \
-e POSTGRES_DB=PracticalDeveloper_development \
-v "<POSTGRES_DATA>:/var/lib/postgresql/data" \
postgres:10.7-alpine;
# Wait about 30 seconds, to give the postgres container time to start
sleep 30
#
# Run the prebuilt dev.to container
# binded to localhost:3000
#
# Algoliasearch API key is required for dev.to,
# for login do consider adding github/twitter keys as well
# see : https://github.com/thepracticaldev/dev.to/blob/master/config/sample_application.yml
#
docker run -d -p 3000:3000 \
--name dev-to-app \
--link dev-to-postgres:db \
-v "<DEVTO_UPLOAD_DIR>:/usr/src/app/public/uploads/" \
-e ALGOLIASEARCH_APPLICATION_ID=<APP_ID> \
-e ALGOLIASEARCH_SEARCH_ONLY_KEY=<SEARH_KEY> \
-e ALGOLIASEARCH_API_KEY=<ADMIN_KEY> \
uilicious/dev.to
#
# Also : do give 5~10 minutes for the server to be up.
# It does take a long time to setup and start
#
PicoCreator
์ ๊ฒ์๋จ
์ด๊ฒ์ ์ด๋ค ์ ํ์ PR์ ๋๊น? (ํด๋น๋๋ ํญ๋ชฉ ๋ชจ๋ ์ฒดํฌ)
์ค๋ช
DEV ๋๋ DEMO ํ๊ฒฝ์ ๋น ๋ฅด๊ฒ ์ค์ ํ๋ ๋ฐ ๋์์ด ๋๋ ๋จ์ผ bash ์คํฌ๋ฆฝํธ
bash-3.2$ ./docker-run.sh
#---
#
# This script will perform the following steps ...
#
# 1) Stop and remove any docker container with the name 'dev-to-postgres' and 'dev-to'
# 2) Reset any storage directories if RUN_MODE starts with 'RESET-'
# 3) Build the dev.to docker image, with the name of 'dev-to:dev' or 'dev-to:demo'
# 4) Deploy the postgres container, mounting '_docker-storage/postgres' with the name 'dev-to-postgres'
# 5) Deploy the dev-to container, with the name of 'dev-to-app', and sets up its port to 3000
#
# To run this script properly, execute with the following (inside the dev.to repository folder)...
# './docker-run.sh [RUN_MODE] [Additional docker envrionment arguments]'
#
# Alternatively to run this script in 'interactive mode' simply run
# './docker-run.sh INTERACTIVE-DEMO'
#
#---
#---
#
# RUN_MODE can either be the following
#
# - 'DEV' : Start up the container into bash, with a quick start guide
# - 'DEMO' : Start up the container, and run dev.to (requries ALGOLIA environment variables)
# - 'RESET-DEV' : Resets postgresql and upload data directory for a clean deployment, before running as DEV mode
# - 'RESET-DEMO' : Resets postgresql and upload data directory for a clean deployment, before running as DEMO mode
# - 'INTERACTIVE-DEMO' : Runs this script in 'interactive' mode to setup the 'DEMO'
#
# So for example to run a development container in bash its simply
# './docker-run.sh DEV'
#
# To run a simple demo, with some dummy data (replace <?> with the actual keys)
# './docker-run.sh DEMO -e ALGOLIASEARCH_APPLICATION_ID=<?> -e ALGOLIASEARCH_SEARCH_ONLY_KEY=<?> -e ALGOLIASEARCH_API_KEY=<?>'
#
# Finally to run a working demo, you will need to provide either...
# './docker-run.sh .... -e GITHUB_KEY=<?> -e GITHUB_SECRET=<?> -e GITHUB_TOKEN=<?>
#
# And / Or ...
# './docker-run.sh .... -e TWITTER_ACCESS_TOKEN=<?> -e TWITTER_ACCESS_TOKEN_SECRET=<?> -e TWITTER_KEY=<?> -e TWITTER_SECRET=<?>
#
# Note that all of this can also be configured via ENVIRONMENT variables prior to running the script
#
#---
And does the deployment using docker. Includes option to do a reset prior to deployment.
Optional contextual information provided here :
์ ๋ํ ์กฐ์ธ์ด ํ์ํฉ๋๋ค ...
if someone can guide me on how to run dev.to in "Production" mode, it would be great in improving the overall docker container performance
๋ฌธ์์ ์ถ๊ฐ๋์์ต๋๊น?
- sample readme for docker hub :
- I can modify readme if this looks good?
์ด PR์ ๊ฐ์ฅ ์ ์ค๋ช ํ๋ gif๋ ๋ฌด์์ ๋๊น?
๊ธฐ๋ถ์ ๊ฐ์ฅ ์ ๋ํ๋ด๋ gif๋ ๋ฌด์์ ๋๊น?
PS: if someone can guide me on how to run dev.to in "Production" mode, it would be great in improving the overall docker container performance, in such a setup.
์ ์ด๋ฌ๋ ๊ฑฐ์ง? ๊ณต์ readme๋ฅผ ์ฌ์ฉํ์ฌ ์๋ฒ๋ฅผ ์ค์ ํ ์ ์์ต๋๊น?
Well it started out with that, and ...
Its not a problem specifically about dev.to, its simply me being not a ruby developer.
All I wanted was to simply spin up a quick server, so that I can try writing some UI test scripts on it (more on that later).
I really didn't want to be figuring out how to install ruby, sorting out missing os dependencies, and fix my npm versions, trying to figure out why the existing docker build have missing images, etc, etc.......
And in the middle of fixing all that, a flashback hit me ...
For this future where dev.to
grows into a series of decentralised dev.to.like
networks operated by the community to happen. We need the site to be something that is quick, and easy to deploy for anyone.
Not just someone who "needs" to know how to ruby, postgres, nodejs, or even docker and docker compose for that matter...
We already have hundreds of other more human hurdles in place to get a software adopted...
And in my subjective experience, the ability to get quick one liner demo up and running goes a long way in convincing others... Less is truly more here...
Convincing others in going beyond using https://dev.to/
itself, but to use its open source codebase, perhaps adapt it to their own needs, or more importantly contribute to it!
For homebrew users, think of how many times have you used this one line for yourself or others
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
๋์์ด ๋์ง ์๋์?
The current script might not yet be there (for example we could auto install docker if its not present, and maybe in the future break the hard reliance on Algolia). But its one more step into that direction.
UI ํ
์คํธ์ ๋ํด ๋ญ๋ผ๊ณ ํ์
จ์ต๋๊น?
๋ด๊ฐ uilicious์์ ์์
ํ๋ ๊ฒ์ ๋ค์๊ณผ ๊ฐ์ ํ
์คํธ ์คํฌ๋ฆฝํธ๋ฅผ ์คํํ๋ ๊ฒ์
๋๋ค.
// Lets go to dev.to
I.goTo("https://dev.to")
// Fill up search
I.fill("Search", "uilicious")
I.pressEnter()
// I should see myself or my co-founder
I.see("Shi Ling")
I.see("Eugene Cheah")
ํ์ ๋ค sharable test result
์์ ๊ฐ์ด.
๊ทธ๋ฌ๋ ์ฌ๊ธฐ์๋ ํ ๊ฐ์ง ํฐ ๋ฌธ์ ๊ฐ ์์ต๋๋ค. Uilicious๋ฟ๋ง ์๋๋ผ ์ผ๋ฐ์ ์ผ๋ก UI ํ
์คํธ๋ฅผ ์ํด ํด๊ฒฐํ๋ ค๊ณ ํฉ๋๋ค...
์ด๋ ๊ฒ์ด ๋ชจ๋๋ฅผ ์ป๊ณ ์์ต๋๋ค ... UI ํ
์คํธ๊ฐ ์ปค๋ฐ๋๋ ์ฆ์ ์คํํ๋ ค๋ฉด ๋จ์ ํ
์คํธ๋ฅผ ์คํํ๋ ๋ฐฉ๋ฒ๊ณผ ๊ฐ์ต๋๋ค. (๊ฐ๋ฐ ํ์ฌ, ๊ณ ๊ฐ ๋๋ ์ผ๋ฐ์ ์ผ๋ก ๋ชจ๋ ๊ฐ๋ฐ์์๊ฒ ์ ์ฉํจ)
๋ถํํ๊ฒ๋ ๋ด๊ฐ ๋ณธ ๋ฐ๋ก๋ ์ฐ๋ฆฌ ํ๋ซํผ์ ๋๋ถ๋ถ์ ์ฌ์ฉ์๋ ํ๋ก๋์
์์๋ง ํ
์คํธํ๊ณ ์์ต๋๋ค. ํ
์คํธ/์คํ
์ด์ง ์๋ฒ๊ฐ ์ ๋ฐ๋ณด๋ค ์ฝ๊ฐ ์ ์ต๋๋ค. ๋ง์ง๋ง์ผ๋ก git push์ ๋ํ ์์ฃผ ์์ ๋ถ๋ถ ํ
์คํธ์
๋๋ค.
๊ฐ๋ฐ ๊ณผ์ ์์ ํ
์คํธ๊ฐ ์คํจํ๊ณ ๊ฐ๋ฐ์์๊ฒ ์๋ฆฌ๋ ๊ฒ์ด ๋น ๋ฅด๋ฉด ๋น ๋ฅผ์๋ก ๋ชจ๋ ์ฌ๋์๊ฒ ๋ ์ข์ต๋๋ค.
๊ทธ๋ฆฌ๊ณ ์ผ๋ฐ์ ์ผ๋ก ๊ฑฐ๊ธฐ์ ๋๋ฌํ๋ ๋ฐ ๊ฐ์ฅ ํฐ ์ฅ์ ๋ฌผ์ ์๋ํ๋ UI ํ
์คํธ๋ฅผ ๋ฐ๋ ๊ฒ๋ฟ๋ง ์๋๋ผ ...
Can you make a build in one step? : If the process takes any more than one step, it is prone to errors
~ over simplifying Joel Spolsky
๋๋ ๋ ๊ตฌ์ฒด์ ์ผ๋ก ๋น๋, ๋ฐฐํฌ ๋ฐ ํ
์คํธ๋ฅผ ํ ๋จ๊ณ๋ก ์ํํ ์ ์์ต๋๊น?
๋ฐ๋ผ์ dev.to๋ฅผ ๋ ์ฝ๊ฒ ๋ง๋ค๊ณ ์คํํ ์ ์๋๋ก ํ๋ ๊ฒ์ด ์ ์ ์์ ํฌ๋ง์
๋๋ค.
๋ค์์ ํด์ผ ํ ์ผ์(๋ค์ ๊ธฐ์ฌ์ @TODO) ์์ ๋ฐฐํฌ๋ฅผ ์ํด travis์ ํจ๊ป ์ฐ๊ฒฐํ๋ ๊ฒ์
๋๋ค. ๋ง์ง๋ง์ผ๋ก git ํธ์๋ก UI ํ
์คํธ ์คํฌ๋ฆฝํธ๋ฅผ ์คํํ ์ ์๋ ํ๋ก์ธ์ค์
๋๋ค.
ํน์ git ํธ์์ ๋ํ ์ ์ฒด UI ํ
์คํธ๋ฅผ ์ํํ๋ ๋ค๋ฅธ ๊ฐ๋ฐ์๋ฅผ ์ํ ์์ ์ฌ์ฉ ์ฌ๋ก๋ก ์ฌ์ฉํ ์ ์์ต๋๋ค....
๊ทธ๋ฆฌ๊ณ ์๋ง๋ ์๋ง๋ ์๋ง๋ dev.to team to sign up for our product. or free trial ๐
์, ํ ๊ฐ์ง ๋ - DEV ๋ชจ๋
./docker-run.sh DEV
ํ
์คํธ ๋ฐ ๋ฐ๋ชจ๋ฟ๋ง ์๋๋ผ ๊ฐ๋ฐ์๋ ๋์์ด ๋๋ ๋จ์ผ bash ์คํฌ๋ฆฝํธ.
๋ณต์ ๋ ๋ฆฌํฌ์งํ ๋ฆฌ์์ ๋ฐ๋ก bash๋ก ์ ์ฒด ๊ฐ๋ฐ ํ๊ฒฝ์ ์ค์ ํ๋ ํ ์ค ๋ช
๋ น์
๋๋ค.
ruby/npm ์ค์น๊ฐ ํ์ํ์ง ์์ต๋๋ค.
PS : If anyone have feedback how I can make this build and deploy script better / etc. Do let me know
์ฆ๊ฑฐ์ด ๋ฐฐ์ก๐๐ผ๐
// Lets go to dev.to
I.goTo("https://dev.to")
// Fill up search
I.fill("Search", "uilicious")
I.pressEnter()
// I should see myself or my co-founder
I.see("Shi Ling")
I.see("Eugene Cheah")
Can you make a build in one step? : If the process takes any more than one step, it is prone to errors
~ over simplifying Joel Spolsky
./docker-run.sh DEV
ํ ์คํธ ๋ฐ ๋ฐ๋ชจ๋ฟ๋ง ์๋๋ผ ๊ฐ๋ฐ์๋ ๋์์ด ๋๋ ๋จ์ผ bash ์คํฌ๋ฆฝํธ.
๋ณต์ ๋ ๋ฆฌํฌ์งํ ๋ฆฌ์์ ๋ฐ๋ก bash๋ก ์ ์ฒด ๊ฐ๋ฐ ํ๊ฒฝ์ ์ค์ ํ๋ ํ ์ค ๋ช ๋ น์ ๋๋ค.
ruby/npm ์ค์น๊ฐ ํ์ํ์ง ์์ต๋๋ค.
PS : If anyone have feedback how I can make this build and deploy script better / etc. Do let me know
์ฆ๊ฑฐ์ด ๋ฐฐ์ก๐๐ผ๐
Reference
์ด ๋ฌธ์ ์ ๊ดํ์ฌ(์์ ์ dev.to ๐ณ ์๋ฒ๋ฅผ ์์ํ์ธ์ - ๋จ์ผ ๋ช ๋ น์ผ๋ก (๊ฑฐ์)!), ์ฐ๋ฆฌ๋ ์ด๊ณณ์์ ๋ ๋ง์ ์๋ฃ๋ฅผ ๋ฐ๊ฒฌํ๊ณ ๋งํฌ๋ฅผ ํด๋ฆญํ์ฌ ๋ณด์๋ค https://dev.to/uilicious/adopt-your-own-devto----with-a-single-command-almost-1c04ํ ์คํธ๋ฅผ ์์ ๋กญ๊ฒ ๊ณต์ ํ๊ฑฐ๋ ๋ณต์ฌํ ์ ์์ต๋๋ค.ํ์ง๋ง ์ด ๋ฌธ์์ URL์ ์ฐธ์กฐ URL๋ก ๋จ๊ฒจ ๋์ญ์์ค.
์ฐ์ํ ๊ฐ๋ฐ์ ์ฝํ ์ธ ๋ฐ๊ฒฌ์ ์ ๋ (Collection and Share based on the CC Protocol.)
์ข์ ์นํ์ด์ง ์ฆ๊ฒจ์ฐพ๊ธฐ
๊ฐ๋ฐ์ ์ฐ์ ์ฌ์ดํธ ์์ง
๊ฐ๋ฐ์๊ฐ ์์์ผ ํ ํ์ ์ฌ์ดํธ 100์ ์ถ์ฒ ์ฐ๋ฆฌ๋ ๋น์ ์ ์ํด 100๊ฐ์ ์์ฃผ ์ฌ์ฉํ๋ ๊ฐ๋ฐ์ ํ์ต ์ฌ์ดํธ๋ฅผ ์ ๋ฆฌํ์ต๋๋ค