kdechant / eamon

A web port of the classic text adventure game, the Wonderful World of Eamon
https://eamon-remastered.com
MIT License
23 stars 5 forks source link

Dockerfile or docker-compose.yml issue? #24

Closed chiperific closed 5 years ago

chiperific commented 5 years ago

Output of $ docker-compose up -d:

ckragt:eamon ckragt$ docker-compose up -d
Building django
Step 1/15 : FROM python:3.6.1
 ---> 955d0c3b1bb2
Step 2/15 : ENV PYTHONUNBUFFERED 1
 ---> Using cache
 ---> f5dc056e67ba
Step 3/15 : ENV IN_DOCKER 1
 ---> Using cache
 ---> 26f6a33d221a
Step 4/15 : USER root
 ---> Using cache
 ---> 9746e509ad2d
Step 5/15 : RUN apt-get update
 ---> Using cache
 ---> 245960e8591c
Step 6/15 : RUN apt-get install -y netcat python-dev libxml2-dev libxslt-dev libffi-dev libssl-dev libmysqlclient-dev
 ---> Using cache
 ---> 44dd90daad15
Step 7/15 : ENV HOME_USER webuser
 ---> Using cache
 ---> 8dc3b8335782
Step 8/15 : ENV HOME_PASS password
 ---> Using cache
 ---> 838d4b3df193
Step 9/15 : RUN id -u ${HOME_USER} &>/dev/null ||     useradd -m -s /bin/bash ${HOME_USER} &&     echo "${HOME_USER}:${HOME_PASS}"|chpasswd &&     adduser ${HOME_USER} sudo &&     echo ${HOME_USER}' ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
 ---> Running in d25ff1561520
chpasswd: (user webuser) pam_chauthtok() failed, error:
Authentication token manipulation error
id: webuser: no such user
chpasswd: (line 1, user webuser) password not changed
ERROR: Service 'django' failed to build: The command '/bin/sh -c id -u ${HOME_USER} &>/dev/null ||     useradd -m -s /bin/bash ${HOME_USER} &&     echo "${HOME_USER}:${HOME_PASS}"|chpasswd &&     adduser ${HOME_USER} sudo &&     echo ${HOME_USER}' ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers' returned a non-zero code: 1

All files are as cloned.

I also made sure I Homebrew installed virtual machine in case that was part of the issue.

kdechant commented 5 years ago

It's been a while since I used the Docker config, so it may be a bit out of date. (I mostly develop with system Python and MySQL on Windows. Docker for Windows still doesn't work well enough, last I tried.) I'll have to try it on my Linux machine some time in the next couple days.

kdechant commented 5 years ago

Still working on this, but getting closer. I had to reinstall Linux on my laptop, so it's been a pain getting Docker running again. I hope to have an update soon.

chiperific commented 5 years ago

Just a note on this, since I know you're a Win 10 and Linux user. I'm on Mac OSX and had so many issues with mysqlclient, relatively similar to this poor soul.

Also lots of problems with python manage.py createsuperuser which I tried to hack around using mysql's CLI to create the superuser to no avail.

All this to say you may not want to bother trying to write MacOS instructions since it's not your use case.

I was mostly trying to play around with the code on a local machine so I could create my own god mode. I gave up and contentedly play from your site.

I'm especially content since I found I could use Chrome Developer Tools to debug certain JS functions and give myself heaps of gold, adjust all my character stats, spells, weapons, etc. I also played a few adventures where I forced every monster to be my friend.

If you're burning hours just to solve this for my machine, I'd say don't worry. I'll find an old PC tower and try again when I'm ready to write a few adventures.

kdechant commented 5 years ago

MySQL is a pain, definitely. The Python mysqlclient doesn't like to install cleanly anywhere but Linux. It's tricky on Windows, as well, for different reasons.

I'm researching the possibility of using SQLite for local development, because it's included out of the box with Python. That would simplify the setup and could even make Docker unnecessary, because all you'd need to run the code would be system Python and NPM.

Short answer: it's possible, but syncing the data to/from the server gets tricky if they use different DBMSes.

On the other hand, writing Docker configs is good practice for me. (A major reason I started this project in the first place was to practice some web tech that I don't get to use in my day job.)

kdechant commented 5 years ago

I couldn't get the Docker setup to work either. It's pretty old and I'm guessing there were some structural changes in some of the Docker Hub images I was using.

Rather than fix Docker, I ended up switching to SQLite as I mentioned above. Now there is no requirement to install/setup MySQL, so setup is much easier. All you need is Python 3.6+ (which any *nix machine should have already) and NPM or Yarn. I removed the Docker setup from the project and updated the installation instructions.