Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy paste to run Ralph locally without any downloads #3804

Open
wants to merge 6 commits into
base: ng
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,57 @@ http://ralph-demo.allegro.tech/
* login: ralph
* password: ralph

If the demo is down, you can create your own in under a minute with:
```
alias docker="sudo docker"
DB=$(docker run --rm --env MARIADB_USER=ralph --env MARIADB_PASSWORD=ralph --env MARIADB_DATABASE=ralph_ng --env MARIADB_ROOT_PASSWORD=ralph -d mariadb)
sleep 10
RALPH=$(docker run --rm --env DATABASE_NAME=ralph_ng --env DATABASE_USER=ralph --env DATABASE_PASSWORD=ralph --env DATABASE_HOST=$DB --env RALPH_DEBUG=1 --link $DB -d allegro/ralph)
docker exec -ti $RALPH ralph migrate # wait for this to finish
cat <<--- > ralph.conf
server {

listen 80;
client_max_body_size 512M;

proxy_set_header Connection "";
proxy_http_version 1.1;
proxy_connect_timeout 300;
proxy_read_timeout 300;

access_log /var/log/nginx/ralph-access.log;
error_log /var/log/nginx/ralph-error.log;

location /static {
alias /static;
access_log off;
log_not_found off;
expires 1M;
}

#location /media {
# alias /var/local/ralph/media;
# add_header Content-disposition "attachment";
#}

location / {
proxy_pass http://$RALPH:8000;
include /etc/nginx/uwsgi_params;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
---
NGINX=$(docker run --rm -v `pwd`/ralph.conf:/etc/nginx/conf.d/default.conf:ro --link $RALPH -p 7777:80 -d nginx)
sleep 3
docker cp $RALPH:/usr/share/ralph/static - | docker cp - $NGINX:/
docker exec -ti $RALPH ralph createsuperuser # creates a login user and password
```
And then navigating to http://localhost:7777
If it fails, increase the sleep values or run the docker commands in separate terminals with -ti instead of -d. so you can know when the image is ready for the next one.

Clean up with `docker stop $NGINX $RALPH $MARIADB; # and remove the downloaded images docker rmi nginx allegro/ralph mariadb`

## Screenshots

![img](https://github.com/allegro/ralph/blob/ng/docs/img/welcome-screen-1.png?raw=true)
Expand Down