mirror of
https://github.com/th3r00t/pyShelf.git
synced 2026-04-28 01:59:35 -04:00
Added default entry point
This commit is contained in:
16
Dockerfile
vendored
16
Dockerfile
vendored
@@ -3,23 +3,23 @@ RUN pacman -Syy
|
|||||||
RUN pacman -Syu --noconfirm
|
RUN pacman -Syu --noconfirm
|
||||||
RUN pacman -S --noconfirm python python-pip git openssh postgresql sudo base-devel
|
RUN pacman -S --noconfirm python python-pip git openssh postgresql sudo base-devel
|
||||||
RUN sudo -u postgres initdb --locale=en_US.UTF-8 -E UTF8 -D /var/lib/postgres/data
|
RUN sudo -u postgres initdb --locale=en_US.UTF-8 -E UTF8 -D /var/lib/postgres/data
|
||||||
RUN systemctl enable postgresql
|
|
||||||
RUN useradd pyshelf && chpasswd pyshelf:pyshelf
|
RUN useradd pyshelf && chpasswd pyshelf:pyshelf
|
||||||
RUN mkdir -p /srv/Books && \
|
RUN mkdir -p /srv/Books && \
|
||||||
mkdir -p /srv/http && \
|
mkdir -p /srv/http && \
|
||||||
mkdir -p /srv/logs/ && \
|
mkdir -p /srv/logs/ && \
|
||||||
|
mkdir -p /run/postgresql && \
|
||||||
touch /srv/logs/pgsql.log && \
|
touch /srv/logs/pgsql.log && \
|
||||||
|
chown postgres.postgres /run/postgresql && \
|
||||||
chown http.pyshelf /srv/Books && \
|
chown http.pyshelf /srv/Books && \
|
||||||
chown http.pyshelf /srv/http && \
|
chown http.pyshelf /srv/http && \
|
||||||
chown postgres /srv/logs/pgsql.log
|
chown postgres.postgres /srv/logs/pgsql.log
|
||||||
RUN systemctl enable sshd
|
ENV PYTHONUNBUFFERED=1
|
||||||
# RUN sudo -u postgres pg_ctl -D /var/lib/postgres/data -l /srv/logs/pgsql.log start
|
VOLUME ['/srv/Books','/srv/http','/srv/logs']
|
||||||
VOLUME ['/srv/Books','/srv/http']
|
|
||||||
# ENV nginx_conf /etc/nginx/nginx.conf
|
|
||||||
ENV PYTHONUNBUFFERED 1
|
|
||||||
WORKDIR /srv/http
|
WORKDIR /srv/http
|
||||||
RUN git clone https://github.com/th3r00t/pyShelf.git /srv/http && \
|
RUN git clone https://github.com/th3r00t/pyShelf.git /srv/http && \
|
||||||
git checkout 0.5.0--docker && pip install -r requirements.txt
|
git checkout 0.5.0--docker && pip install -r requirements.txt
|
||||||
|
# RUN sudo -u postgres pg_ctl -D /var/lib/postgres/data -l /srv/logs/pgsql.log start
|
||||||
# RUN sudo -u postgres psql -f create_db.sql
|
# RUN sudo -u postgres psql -f create_db.sql
|
||||||
EXPOSE 80 22 8000
|
|
||||||
# RUN gunicorn pyShelf.wsgi 8000:8000
|
# RUN gunicorn pyShelf.wsgi 8000:8000
|
||||||
|
EXPOSE 80 22 8000
|
||||||
|
CMD ["sh", "-c","entry.sh"]
|
||||||
|
|||||||
6
entry.sh
vendored
Executable file
6
entry.sh
vendored
Executable file
@@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
sudo -u postgres pg_ctl -D /var/lib/postgres/data -l /srv/logs/pgsql.log start
|
||||||
|
sudo -u postgres psql -f create_db.sql
|
||||||
|
rm entry.sh
|
||||||
|
echo "sudo -u postgres pg_ctl -D /var/lib/postgres/data -l /srv/logs/lgsql.log start" > entry.sh
|
||||||
|
chmod +x entry.sh
|
||||||
Reference in New Issue
Block a user