Skip to content

Commit

Permalink
Cleaning files with gbrowse-clean and supercronic
Browse files Browse the repository at this point in the history
  • Loading branch information
bunop committed Nov 13, 2017
1 parent e60aa91 commit 9a96d8e
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 2 deletions.
3 changes: 2 additions & 1 deletion compose/gbrowse/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Then copy all gbrowse2 database data in `/data` directory. Then exit container:

```
$ cp -ra /var/lib/gbrowse2/databases/* /data/
$ chown www-data.www-data /data/
$ exit
```

Expand Down Expand Up @@ -111,7 +112,7 @@ Then you could copy files like this:
$ cd /var/lib/gbrowse2/databases
$ mkdir volvox
$ cd /var/www/html/gbrowse2/tutorial/
$ cp data_files/* /var/lib/gbrowse2/databases/volvox/
$ cp -ra data_files/* /var/lib/gbrowse2/databases/volvox/
$ cd /var/lib/gbrowse2/databases
$ chown -R www-data.www-data volvox
```
Expand Down
24 changes: 24 additions & 0 deletions compose/gbrowse/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,30 @@ services:
- back-tier


supercronic:
build: ./gbrowse

command: ["supercronic", "/etc/cron.d/gbrowse-clean"]

volumes:
- type: volume
source: ./gbrowse/conf.d
target: /etc/gbrowse2

- type: bind
source: /etc/localtime
target: /etc/localtime
read_only: true

- type: volume
source: ./gbrowse-data
target: /var/lib/gbrowse2/databases

- type: bind
source: gbrowse-cache
target: /var/tmp/gbrowse2


db:
# get the latest mysql server
build: ./db
Expand Down
18 changes: 18 additions & 0 deletions compose/gbrowse/gbrowse/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -193,5 +193,23 @@ EXPOSE 443
# add this symlink to work with gbrowse scripts
RUN ln -s /etc/gbrowse2/ /etc/GBrowse2

# install curl
RUN apt-get update && apt-get install -y \
curl \
&& rm -rf /var/lib/apt/lists/*

# install supercronic (https://github.com/aptible/supercronic/)
ENV SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.1.4/supercronic-linux-amd64 \
SUPERCRONIC=supercronic-linux-amd64 \
SUPERCRONIC_SHA1SUM=3a631023f9f9dd155cfa0d1bb517a063d375055a

RUN curl -fsSLO "$SUPERCRONIC_URL" \
&& echo "${SUPERCRONIC_SHA1SUM} ${SUPERCRONIC}" | sha1sum -c - \
&& chmod +x "$SUPERCRONIC" \
&& mv "$SUPERCRONIC" "/usr/local/bin/${SUPERCRONIC}" \
&& ln -s "/usr/local/bin/${SUPERCRONIC}" /usr/local/bin/supercronic

COPY gbrowse-clean /etc/cron.d/gbrowse-clean

# execute apache in foreground
CMD ["/usr/local/bin/apache2-foreground"]
2 changes: 1 addition & 1 deletion compose/gbrowse/gbrowse/conf.d/volvox.conf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ examples = ctgA
initial landmark = ctgA:5000..10000

# Restrict access to registered user
restrict = require valid-user
# restrict = require valid-user

########################
# Default glyph settings
Expand Down
3 changes: 3 additions & 0 deletions compose/gbrowse/gbrowse/gbrowse-clean
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

# m h dom mon dow command
0 * * * * sudo -u www-data /usr/local/bin/gbrowse_clean.pl

0 comments on commit 9a96d8e

Please sign in to comment.