Skip to content
This repository was archived by the owner on May 4, 2023. It is now read-only.

Commit d504e20

Browse files
committed
Add FF_SYNCSERVER_SQLURI env var (Issue #5)
No need to put syncserver.ini in data folder
1 parent 010025f commit d504e20

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## 1.8.0-RC3 (2019/01/22)
4+
5+
* Add `FF_SYNCSERVER_SQLURI` env var (Issue #5)
6+
* No need to put `syncserver.ini` in data folder
7+
38
## 1.8.0-RC2 (2018/07/27)
49

510
* Switch to Alpine 3.8 based image

Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ RUN apk --update --no-cache add \
2727
&& git clone https://github.com/mozilla-services/syncserver app \
2828
&& cd app \
2929
&& git reset --hard $SHA1_COMMIT \
30+
&& pip install pymysql \
3031
&& pip install --upgrade --no-cache-dir -r requirements.txt \
3132
&& pip install --upgrade --no-cache-dir -r dev-requirements.txt \
3233
&& apk del build-dependencies \
@@ -38,4 +39,4 @@ EXPOSE 5000
3839
VOLUME [ "/data" ]
3940

4041
ENTRYPOINT [ "/entrypoint.sh" ]
41-
CMD [ "/usr/local/bin/gunicorn", "--paste", "/data/syncserver.ini" ]
42+
CMD [ "/usr/local/bin/gunicorn", "--paste", "/syncserver.ini" ]

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,11 @@ If you are interested, [check out](https://hub.docker.com/r/crazymax/) my other
3434
* `FF_SYNCSERVER_SECRET` : This is a secret key used for signing authentication tokens. It should be long and randomly-generated.
3535
* `FF_SYNCSERVER_ALLOW_NEW_USERS` : Set this to `false` to disable new-user signups on the server. Only request by existing accounts will be honoured (default `true`).
3636
* `FF_SYNCSERVER_FORCE_WSGI_ENVIRON` : Set this to `true` to work around a mismatch between public_url and the application URL as seen by python, which can happen in certain reverse-proxy hosting setups (default `false`).
37+
* `FF_SYNCSERVER_SQLURI` : Defines the database in which to store all server data (default `sqlite:///data/syncserver.db`).
3738

3839
### Volumes
3940

40-
* `/data` : Contains SQLite database
41+
* `/data` : Contains SQLite database if `FF_SYNCSERVER_SQLURI` is untouched
4142

4243
### Ports
4344

entrypoint.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ TZ=${TZ:-UTC}
44
FF_SYNCSERVER_PUBLIC_URL=${FF_SYNCSERVER_PUBLIC_URL:-http://localhost:5000/}
55
FF_SYNCSERVER_ALLOW_NEW_USERS=${FF_SYNCSERVER_ALLOW_NEW_USERS:-true}
66
FF_SYNCSERVER_FORCE_WSGI_ENVIRON=${FF_SYNCSERVER_FORCE_WSGI_ENVIRON:-false}
7+
FF_SYNCSERVER_SQLURI=${FF_SYNCSERVER_SQLURI:-sqlite:///data/syncserver.db}
78

89
# Timezone
910
echo "Setting timezone to ${TZ}..."
@@ -19,7 +20,7 @@ fi
1920

2021
# Config
2122
echo "Generating configuration..."
22-
cat > "/data/syncserver.ini" <<EOL
23+
cat > "/syncserver.ini" <<EOL
2324
[server:main]
2425
use = egg:gunicorn
2526
host = 0.0.0.0
@@ -36,7 +37,7 @@ use = egg:syncserver
3637
public_url = ${FF_SYNCSERVER_PUBLIC_URL}
3738
3839
# This defines the database in which to store all server data.
39-
sqluri = sqlite:////data/syncserver.db
40+
sqluri = ${FF_SYNCSERVER_SQLURI}
4041
4142
# This is a secret key used for signing authentication tokens.
4243
# It should be long and randomly-generated.

0 commit comments

Comments
 (0)