2018-02-22 13:52:21 +01:00
|
|
|
FROM microsoft/mssql-server-linux:2017-CU4
|
2017-08-18 04:28:56 +02:00
|
|
|
|
2017-08-21 16:58:00 +02:00
|
|
|
RUN apt-get update \
|
|
|
|
&& apt-get install -y --no-install-recommends \
|
|
|
|
cron \
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
2018-03-26 17:21:03 +02:00
|
|
|
RUN groupadd -g 999 bitwarden \
|
|
|
|
&& useradd -r -u 999 -g bitwarden bitwarden
|
|
|
|
|
2017-08-21 16:58:00 +02:00
|
|
|
COPY crontab /etc/cron.d/bitwarden-cron
|
|
|
|
RUN chmod 0644 /etc/cron.d/bitwarden-cron \
|
2018-03-26 17:21:03 +02:00
|
|
|
&& touch /var/log/cron.log \
|
|
|
|
&& chown bitwarden:bitwarden /var/log/cron.log
|
2017-08-21 16:58:00 +02:00
|
|
|
|
|
|
|
COPY backup-db.sql /
|
|
|
|
COPY backup-db.sh /
|
2018-03-24 03:16:57 +01:00
|
|
|
COPY entrypoint.sh /
|
2018-03-26 17:21:03 +02:00
|
|
|
|
2018-03-26 20:29:08 +02:00
|
|
|
RUN mkdir -p /etc/bitwarden/mssql/backups \
|
2018-03-26 17:21:03 +02:00
|
|
|
&& chown -R bitwarden:bitwarden /etc/bitwarden \
|
2018-03-26 20:34:49 +02:00
|
|
|
&& mkdir -p /var/opt/mssql/data \
|
2018-03-26 17:21:03 +02:00
|
|
|
&& chown -R bitwarden:bitwarden /var/opt/mssql \
|
|
|
|
&& chmod +x /entrypoint.sh \
|
|
|
|
&& chmod +x /backup-db.sh \
|
|
|
|
&& chown bitwarden:bitwarden /entrypoint.sh \
|
|
|
|
&& chown bitwarden:bitwarden /backup-db.sh \
|
|
|
|
&& chown bitwarden:bitwarden /backup-db.sql
|
|
|
|
|
|
|
|
USER bitwarden
|
2017-08-18 04:28:56 +02:00
|
|
|
ENTRYPOINT ["/entrypoint.sh"]
|