Skip to content

Commit

Permalink
switch to latest baseimage allowing custom TZ and UID
Browse files Browse the repository at this point in the history
  • Loading branch information
umputun committed Aug 23, 2019
1 parent 7fbf2cd commit 141c754
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 7 deletions.
9 changes: 5 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ RUN cd /srv/frontend && \
rm -rf ./node_modules


FROM umputun/baseimage:app-latest
FROM umputun/baseimage:app

WORKDIR /srv

ADD entrypoint.sh /entrypoint.sh
ADD docker-init.sh /entrypoint.sh
ADD backend/scripts/backup.sh /usr/local/bin/backup
ADD backend/scripts/restore.sh /usr/local/bin/restore
ADD backend/scripts/import.sh /usr/local/bin/import
Expand All @@ -97,5 +97,6 @@ RUN ln -s /srv/remark42 /usr/bin/remark42
EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=3s CMD curl --fail http://localhost:8080/ping || exit 1

CMD ["server"]
ENTRYPOINT ["/entrypoint.sh"]
COPY docker-init.sh /srv/init.sh
RUN chmod +x /srv/init.sh
CMD ["/srv/remark42", "server"]
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,39 @@ Admins/moderators should be defined in `docker-compose.yml` as a list of user ID
To get user id just login and click on your username or any other user you want to promote to admins.
It will expand login info and show full user ID.
#### Docker parameters
Two parameters allow to customize docker container on the system level:
- `APP_UID` - sets UID to run remark42 application in container (default=1001)
- `TIME_ZONE` - sets time zone of remark42 container (default=America/Chicago)
_see [umputun/baseimage](https://github.com/umputun/baseimage) for more details_
example of compose:
```yaml
version: '2'
services:
remark42:
image: umputun/remark42:latest
restart: always
container_name: "remark42"
environment:
- APP_UID=2000 # runs remark42 app with non-default UID
- TIME_ZINE=GTC # sets container time to UTC
- REMARK_URL=https://demo.remark42.com # url pointing to your remark42 server
- SITE=YOUR_SITE_ID # site ID, same as used for `site_id`, see "Setup on your website"
- SECRET=abcd-123456-xyz-$%^& # secret key
- AUTH_GITHUB_CID=12345667890 # oauth2 client ID
- AUTH_GITHUB_CSEC=abcdefg12345678 # oauth2 client secret
volumes:
- ./var:/srv/var # persistent volume to store all remark42 data
```


### Setup on your website

#### Comments
Expand Down
2 changes: 2 additions & 0 deletions compose-dev-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ services:
- "8084:8084" # local oauth2 server

environment:
# - APP_UID=1000
# - TIME_ZONE=GMT
- REMARK_URL=http://127.0.0.1:8080
- SECRET=12345
- STORE_BOLT_PATH=/srv/var/db
Expand Down
3 changes: 0 additions & 3 deletions entrypoint.sh → docker-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,3 @@ sed -i "s|https://demo.remark42.com|${REMARK_URL}|g" /srv/web/*.js
sed -i "/REMOVE-START/,/REMOVE-END/d" /srv/web/iframe.html

chown -R app:app /srv/var 2>/dev/null

echo "start remark42 server"
/sbin/su-exec app /srv/remark42 $@

0 comments on commit 141c754

Please sign in to comment.