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

Added docker environment #617

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

justanotherinternetguy
Copy link
Contributor

Made some small changes, fixed docker filepaths with __file__.
LMK if there's anything else :)

Copy link
Collaborator

@dqian3 dqian3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments marking areas where the docker setup would break local setups. Note that this isn't just so that it's convenient for people who don't want to use Docker, as is these changes would likely break our deployment :).

Also, it seems like the tests (which to be fair are rather outdated) are broken because they reference some /app path.

Finally, I might make a few small tweaks to the README myself before merging. If you want, I can also handle all the changes to that (including addressing the comment below about keeping the old instructions). Just lmk!

Thanks again for doing this work!

@@ -4,172 +4,42 @@ This repository holds the code for [wikispeedruns.com](https://wikispeedruns.com

## 1. Prerequisites

- Python 3.7 or greater
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can move this to a separate ReadMe linked from this main one. I think it's still helpful to have for those who aren't familar with Docker, as well as essentially documentation for what Docker is doing.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are also some optional steps to setup features like achievements and such that could be useful still.


app.json_encoder = CustomJSONEncoder

app.config.from_file('../config/default.json', json.load)
app.config.from_file('/app/config/default.json', json.load)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would need to change this here to reference base_dir as well so that the local builds don't break.

image: mysql:8
environment:
MYSQL_ROOT_PASSWORD: rootpassword
MYSQL_USER: testuser
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not just setup the user here?

@@ -1,7 +1,7 @@
{
"SECRET_KEY": "ahhhhhhhhhh",

"MYSQL_HOST": "127.0.0.1",
"MYSQL_HOST": "mysql",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also assumes a Docker setup, which while is the default, doesn't mean we should break other dev environments. I think the best way to handle this would be to have a config/docker.json with this Docker setup, and then set some environment variable in docker or something to signal the application to use that config.

scripts/create_admin_account.py Outdated Show resolved Hide resolved
@@ -10,12 +9,15 @@

import bcrypt


docker_fp = "/app/config/default.json"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as other comments, this should be redone either using __file__ or a command line argument to get the path.

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

Successfully merging this pull request may close these issues.

2 participants