…
|
||
---|---|---|
.. | ||
bin | ||
compiles | ||
texlive | ||
.gitignore | ||
dev.env | ||
docker-compose.dev.yml | ||
docker-compose.yml | ||
README.md | ||
webpack.config.dev-env.js |
Overleaf Community Edition, development environment
Building and running
In this develop
directory, build and start the services:
bin/up
Once the services are running, open http://localhost/launchpad to create the first admin account.
After making any changes to the code, run bin/up
manually to rebuild the changed Docker images and recreate the changed containers.
TeX Live
Compiling a PDF requires building a TeX Live image to handle the compilation inside Docker:
docker build texlive -t texlive-full
Note
To compile on a macOS host, you'll need to override the path to the Docker socket by creating a
.env
file in this directory, containingDOCKER_SOCKET_PATH=/var/run/docker.sock.raw
Development
To avoid running bin/up
after every code change, you can run Overleaf
Community Edition in development mode, where services will automatically
update on code changes. To do this, use the included bin/dev
script:
bin/dev
This will start all services using nodemon
, which will automatically monitor
the code and restart the services as necessary. This will incur a performance
hit, especially on macOS, so in order to only start a subset of the services,
provide a space-separated list to the bin/dev
script.
bin/dev [service1] [service2] ... [serviceN]
Note
Starting the
web
service in development mode will only update theweb
service when backend code changes. In order to automatically update frontend code as well, make sure to start thewebpack
service in development mode as well.
Debugging
When run in development mode most services expose a debugging port to which you can attach a debugger such as the inspector in Chrome's Dev Tools or one integrated into an IDE. The following table shows the port exposed on the host machine for each service:
Service | Port |
---|---|
web |
9229 |
clsi |
9230 |
chat |
9231 |
contacts |
9232 |
docstore |
9233 |
document-updater |
9234 |
filestore |
9235 |
notifications |
9236 |
real-time |
9237 |
track-changes |
9238 |
To attach to a service using Chrome's remote debugging, go to
chrome://inspect/ and make sure Discover network targets is checked. Next
click Configure... and add an entry localhost:[service port]
for each of the
services you want to attach a debugger to.
After adding an entry, the service will show up as a Remote Target that you can inspect and debug.