Comments (13)
Since @jzohrab release Lute v2-really-alpha, dockerise lute become very simple.
Make and put these two files in lute dir, and run docker compose up -d
.
Dockerfile
FROM php:8.2
# Install mecab for Japanese support
RUN apt-get update -y
RUN apt-get install -y mecab mecab-ipadic-utf8
# Clear cache
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
WORKDIR /lute/public
CMD ["php", "-S", "0.0.0.0:8000"]
docker-compose.yml
version: "3.9"
services:
lute:
build:
context: ./
dockerfile: Dockerfile
container_name: lute_2
restart: always
ports:
- 8000:8000
volumes:
- .:/lute
working_dir: /lute/public
command: ["php", "-S", "0.0.0.0:8000"]
from lute.
What is the default environment that SQL is expecting here?
environment:
MYSQL_DATABASE: lute
MYSQL_USER: lute
MYSQL_PASSWORD: password
MYSQL_ROOT_PASSWORD: password
from lute.
Hi @16amattice , I figure that the db container would be a full installation of MySQL with the default information, which in some cases can be supplied during installation. https://hub.docker.com/_/mysql has some notes.
Perhaps all of this stuff could be passed to docker compose as a config file. Not sure! Perhaps every user should just be using a default config w/ default environment, so that it can be installed and run with no extra configuration -- would also make the deployment more standard, so that users don't accidentally mess up their config.
All open for discussion, of course. This is meant to simplify things for users to install. :-) Does that make sense? Cheers, jz
from lute.
Hello! Didn't see this discussion before I started working on it. Feel free to add to my PR, not got it fully working just yet, the tests can't connect to the test DB, think it needs some env changes
from lute.
Hi @AdamHebby, thanks for the PR! I'll check it out -- have to get my Docker working first :-) Re the tests, it could be due to how Symfony manages the environments. When it's connecting to the regular DB, it uses .env
, or is overridden with .env.local
, but when running tests, it connects to .env.test
or .env.test.local
(ref https://symfony.com/doc/current/testing.html#customizing-environment-variables). Lute then requires the test database name to start with test_
, because the tests are destructive and I'm paranoid.
fyi, my .env.test.local looks like this:
$ cat .env.test.local
DB_DATABASE=test_lute
DB_HOSTNAME=localhost
DB_USER=root
DB_PASSWORD=root
DATABASE_URL=mysql://${DB_USER}:${DB_PASSWORD}@${DB_HOSTNAME}/${DB_DATABASE}?serverVersion=8&charset=utf8
from lute.
Hi @jzohrab No worries! Yeah, it's mostly due to me assuming prod only and docker-compose only using .env, might either need a second docker-compose-test or something to only use the test env vars and run the app-init script with an argument to run the DB migrations on the test DB. Just needs a bit of thought around it is all.
from lute.
Right, compose-test might make sense because then it's very explicit; or perhaps docker-compose-dev b/c really it's best to do dev in a specific environment. Whatever, as long as it's obvious for devs ... but then, maybe there would be a completely different setup for them (e.g. mounting the code dir as a volume or something), vs for end users (maybe everything just builds into the images?). I don't know what makes the most sense here. :-)
Lute manages the database migrations automatically ... every time the app connects to the db, it checks the db migrations to see if anything needs to be run. Yep, it's very wasteful :-) but it's just a single disk check for files against the db, so I didn't mind, and I don't notice it while running.
from lute.
I'll have to look at this tomorrow as well...I got a base setup that I believe is almost ready to run...just some things I have to tweak. I'll look at the PR tomorrow as well in case we are doing double work here lol
from lute.
Super, thank you @16amattice .
from lute.
Not a problem! Looked a bit at the draft PR..and I added the composer install directly to the build. I made some other changes and am at the point of setting up the environment stuff. Just trying to stick with the portability aspect. I'll finish up tomorrow and throw a PR in.
from lute.
A great start, thank you @99MengXin ! I'm going to mess around with this a bit more before putting the dockerfile and compose into the repo. I'm going to see what I can do for the following:
- prebuilt images pushed to docker hub, with the full app code in the image
- storing the db and the images in mounted volume
from lute.
Closing! The v2 beta has a working Docker image that runs well on a Mac. I'm going to assume that it will work on other systems as well ... and if it doesn't, then that's a separate dev ticket. Thanks to @16amattice , @AdamHebby , and @99MengXin for your notes, they all helped get this started. Cheers! jz
from lute.
Closing! The v2 beta has a working Docker image that runs well on a Mac. I'm going to assume that it will work on other systems as well ... and if it doesn't, then that's a separate dev ticket. Thanks to @16amattice , @AdamHebby , and @99MengXin for your notes, they all helped get this started. Cheers! jz
Always happy to help and good luck!
from lute.
Related Issues (20)
- Error on import: "...Integrity constraint violation: 19 UNIQUE constraint failed: words.WoTextLC, words.WoLgID" HOT 1
- Change how Lute displays overlapping Terms, so that words/characters aren't written twice
- Bust javascript cache on release HOT 1
- Raspberry Pi installation fails HOT 3
- Stats wrong for Chinese text HOT 5
- Japanese ctrl-c not respecting paragraphs HOT 2
- Ability to remove "Mark rest as known" button HOT 4
- Creating a registry for the app image in docker hub is possible? HOT 2
- Missing る in texts HOT 2
- Support multiple parents HOT 2
- Preserve term case for German nouns HOT 3
- Broken RTL languages support. HOT 9
- Bare metal install throws unless MeCab is installed? HOT 1
- [Bug] Turkish İi Iı casing problem HOT 8
- Fix Windows GitHub CI HOT 4
- Hover window sometimes gets stuck HOT 4
- Consider different way of handling "reset" after demo HOT 1
- Image can't be selected if the "border" pushes it to a new line HOT 3
- Changing case of Turkish words not working HOT 3
- Fatal error after container install HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lute.