Skip to content
This repository has been archived by the owner on Nov 24, 2021. It is now read-only.

How to deploy with Docker? #2

Open
bortkiewicz opened this issue Feb 24, 2021 · 10 comments
Open

How to deploy with Docker? #2

bortkiewicz opened this issue Feb 24, 2021 · 10 comments

Comments

@bortkiewicz
Copy link

I have compiled the Dockerfile using:

sudo docker build -t syzojdemo.

After the image was built, I did:

sudo docker run -p 8080:80 436fe070f4e3

Then it outputs what looks like an error message:

HEAD is now at e689027 Update config
Please tell your frontend host (or IP:PORT) with -e FRONTEND. e.g. http://demo.syzoj.org
This host should be proxy_pass-ed to container:2001.

After this, whenever I try sudo docker start 58143fba4fa3, it starts and then promptly exits.

Is there something I did wrong?

Thank you very much!

@Menci
Copy link
Member

Menci commented Feb 24, 2021 via email

@Menci
Copy link
Member

Menci commented Feb 24, 2021

I added a README. Let me know if it works or not.

@bortkiewicz
Copy link
Author

I'm trying it currently - the download speed is pretty slow.

In the meantime, just to clarify - I replace nginx.conf with the given configuration file, and replace 172.20.0.2 with the "inet" value for "docker0" when I run ifconfig? Also, what is meant by "# But you need a copy of mysql's initial data directory of this image?"

Thanks again.

@bortkiewicz
Copy link
Author

nginx reports 502 Bad Gateway when I access it through http and I'm unable to connect through https.
On a related note, the given nginx.conf doesn't work as-is; I need to encapsulate it in the http section of nginx.conf.

@Menci
Copy link
Member

Menci commented Feb 26, 2021 via email

@bortkiewicz
Copy link
Author

well at least the website loads now

I get this, instead of the SYZOJ main page:

image

@bortkiewicz
Copy link
Author

Would this be related to the fact that I set -e FRONTEND=https://IP but I'm accessing it through http://IP? The website won't load if I try to access it through https://IP.

@Menci
Copy link
Member

Menci commented Feb 26, 2021 via email

@bortkiewicz
Copy link
Author

5GB ram... bruh. My server only has 2GB ram.

Are there prebuilt images? Or is it possible to first build on my desktop and then copy the image to the server?

@Menci
Copy link
Member

Menci commented Feb 26, 2021

There is prebuilt bundle of syzoj-ng-app's tagged versions, on NPM. I use jsDelivr on my production website.

But this demo builds everytime, in order to run the version of latest commit.

You can follow syzoj-ng and syzoj-ng-app's README, or look into the docker image's start.sh to deploy without docker.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants