Fixed issues with running backend
This commit is contained in:
parent
19f2b99d7e
commit
d86bb23c88
57
README.org
57
README.org
@ -69,10 +69,6 @@
|
||||
delivered on the 8080 port. If you wish to deliver content to another port,
|
||||
you can edit this file.
|
||||
#+BEGIN_SRC sh
|
||||
# Release mode
|
||||
RELEASE="release" ./start.sh
|
||||
|
||||
# Debug mode
|
||||
./start.sh
|
||||
#+END_SRC
|
||||
|
||||
@ -85,20 +81,6 @@
|
||||
#+END_SRC
|
||||
|
||||
And then you can run it:
|
||||
#+BEGIN_SRC sh
|
||||
docker run \
|
||||
-p 8080:8080 \
|
||||
-e RELEASE="release" \
|
||||
--restart always \
|
||||
--detach \
|
||||
--name owb \
|
||||
owb:1.0
|
||||
#+END_SRC
|
||||
|
||||
If you wish to run this in development mode, you could attach a volume so
|
||||
the Dart and SCSS code are linked between your container and your
|
||||
filesystem. This will also make ~webserver~ run in development mode; expect
|
||||
shorter Dart compilation time, but slower Dart code execution.
|
||||
#+BEGIN_SRC sh
|
||||
docker run \
|
||||
-p 8080:8080 \
|
||||
@ -117,22 +99,12 @@
|
||||
docker-compose up --detach
|
||||
#+END_SRC
|
||||
|
||||
If, as above, you wish to enter development mode, you could modify the
|
||||
~docker-compose.yml~ file like so:
|
||||
#+BEGIN_SRC yaml
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
web:
|
||||
build: .
|
||||
environment:
|
||||
- RELEASE="debug"
|
||||
ports:
|
||||
- 8080:8080
|
||||
restart: always
|
||||
volumes:
|
||||
- ./web/:/app/web/
|
||||
#+END_SRC
|
||||
** Running in development mode
|
||||
To run this backend in development mode, you will have to remove the
|
||||
~--release~ option from the ~webdev~ command in the ~start.sh~ file. This
|
||||
will allow webdev to compile Dart files faster, but at the price of slower
|
||||
compiled Javascript files. If you use Docker, don’t forget to rebuild your
|
||||
image.
|
||||
|
||||
** How can I use this in my org files?
|
||||
Let’s say you serve your files on org.example.com, add the following lines to
|
||||
@ -152,11 +124,22 @@
|
||||
such as Nginx. You could have for example the following lines:
|
||||
#+BEGIN_SRC nginx
|
||||
location /dart {
|
||||
root http://localhost:8080/dart;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_pass http://localhost:8080/dart;
|
||||
}
|
||||
|
||||
location /style {
|
||||
root http://localhost:8080/style;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_pass http://localhost:8080/style;
|
||||
}
|
||||
location /packages {
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_pass http://localhost:8080/packages;
|
||||
}
|
||||
#+END_SRC
|
||||
|
||||
|
@ -1,8 +1,10 @@
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
web:
|
||||
owb:
|
||||
build: .
|
||||
ports:
|
||||
- 8010:8080
|
||||
restart: always
|
||||
volumes:
|
||||
- ./web:/app/web
|
||||
|
19
start.sh
19
start.sh
@ -1,18 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
function start_release() {
|
||||
echo "Starting backend in RELEASE mode"
|
||||
sass --watch web/style/:web/style -tcompressed &
|
||||
webdev serve --release --hostname 0.0.0.0
|
||||
}
|
||||
|
||||
function start_debug() {
|
||||
echo "Starting backend in DEBUG mode"
|
||||
sass --watch web/style/:web/style -tcompressed &
|
||||
webdev serve --hostname 0.0.0.0
|
||||
}
|
||||
|
||||
echo Relase: $RELEASE
|
||||
[ "$RELEASE" == "release" ] \
|
||||
&& start_release \
|
||||
|| start_debug
|
||||
sass --watch web/style/:web/style -tcompressed &
|
||||
webdev serve --release --hostname 0.0.0.0
|
||||
|
Reference in New Issue
Block a user