mirror of
https://github.com/pinry/pinry.git
synced 2025-11-13 00:25:41 +01:00
Refactor: Use shortter path for project location
This commit is contained in:
@@ -22,7 +22,6 @@ RUN groupadd -g 2300 tmpgroup \
|
||||
&& groupdel tmpgroup
|
||||
|
||||
RUN mkdir /data
|
||||
RUN mkdir -p /data/logs
|
||||
RUN chown -R www-data:www-data /data
|
||||
|
||||
RUN apt-get update \
|
||||
@@ -30,12 +29,13 @@ RUN apt-get update \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& apt-get autoclean
|
||||
|
||||
# required for other database options
|
||||
RUN pip --no-cache-dir install pipenv gunicorn mysqlclient psycopg2 cx-Oracle
|
||||
|
||||
# COPY and start installation
|
||||
COPY . /srv/www/pinry/
|
||||
COPY . /pinry
|
||||
|
||||
RUN cd /srv/www/pinry \
|
||||
RUN cd /pinry \
|
||||
&& pipenv install --three --system --clear
|
||||
|
||||
# config nodejs
|
||||
@@ -44,14 +44,13 @@ RUN bash n 10
|
||||
RUN npm -g install yarn
|
||||
|
||||
# build frontend
|
||||
RUN cd /srv/www/pinry/pinry-spa/ && yarn install && yarn build
|
||||
RUN cd /pinry/pinry-spa/ && yarn install && yarn build
|
||||
|
||||
# Load in all of our config files.
|
||||
ADD docker/nginx/nginx.conf /etc/nginx/nginx.conf
|
||||
ADD docker/nginx/sites-enabled/default /etc/nginx/sites-enabled/default
|
||||
ADD docker/scripts/* /scripts/
|
||||
|
||||
# 80 is for nginx web, /data contains static files and database /start runs it.
|
||||
EXPOSE 80
|
||||
VOLUME ["/data"]
|
||||
CMD ["/scripts/start.sh"]
|
||||
CMD ["/pinry/docker/scripts/start.sh"]
|
||||
|
||||
@@ -2,10 +2,10 @@ server {
|
||||
listen 80 default;
|
||||
server_name _;
|
||||
|
||||
access_log /data/logs/access.log;
|
||||
error_log /data/logs/error.log;
|
||||
access_log /data/nginx-access.log;
|
||||
error_log /data/nginx-error.log;
|
||||
|
||||
root /srv/www/pinry/pinry-spa/dist/;
|
||||
root /pinry/pinry-spa/dist/;
|
||||
|
||||
location /static {
|
||||
alias /data/static;
|
||||
@@ -22,7 +22,7 @@ server {
|
||||
}
|
||||
|
||||
location / {
|
||||
root /srv/www/pinry/pinry-spa/dist/;
|
||||
root /pinry/pinry-spa/dist/;
|
||||
access_log off;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,8 +22,8 @@ local_settings_file="/data/local_settings.py"
|
||||
# Create local_settings.py
|
||||
if [ ! -f "${local_settings_file}" ];
|
||||
then
|
||||
cp "/srv/www/pinry/settings/local_settings.example.py" "${local_settings_file}"
|
||||
cp "/pinry/pinry/settings/local_settings.example.py" "${local_settings_file}"
|
||||
gen_key
|
||||
sed -i "s/secret\_key\_place\_holder/${SECRET_KEY}/" "${local_settings_file}"
|
||||
ln -s "${local_settings_file}" "/srv/www/pinry/settings/local_settings.py"
|
||||
ln -s "${local_settings_file}" "/pinry/pinry/settings/local_settings.py"
|
||||
fi
|
||||
|
||||
@@ -8,17 +8,18 @@
|
||||
# Authors: Isaac Bythewood
|
||||
# Updated: Aug 19th, 2014
|
||||
# -----------------------------------------------------------------------------
|
||||
PROJECT_ROOT="/pinry"
|
||||
|
||||
bash /scripts/bootstrap.sh
|
||||
|
||||
# If static files don't exist collect them
|
||||
cd /srv/www/pinry
|
||||
cd ${PROJECT_ROOT}
|
||||
python manage.py collectstatic --noinput
|
||||
|
||||
# If database doesn't exist yet create it
|
||||
if [ ! -f /data/production.db ]
|
||||
then
|
||||
cd /srv/www/pinry
|
||||
cd ${PROJECT_ROOT}
|
||||
python manage.py migrate --noinput --settings=pinry.settings.docker
|
||||
fi
|
||||
|
||||
@@ -28,5 +29,5 @@ chown -R www-data:www-data /data
|
||||
# start all process
|
||||
/usr/sbin/nginx
|
||||
|
||||
cd /srv/www/pinry/
|
||||
/scripts/_start_gunicorn.sh
|
||||
cd ${PROJECT_ROOT}
|
||||
./docker/scripts/_start_gunicorn.sh
|
||||
|
||||
@@ -12,5 +12,4 @@ fi
|
||||
|
||||
sudo docker run -d=true -p=80:80 \
|
||||
-v=${DATA_PATH}:/data \
|
||||
-v=${SETTINGS_PATH}:/srv/www/pinry/pinry/settings/local_settings.py \
|
||||
pinry/pinry /scripts/start.sh
|
||||
pinry/pinry
|
||||
|
||||
Reference in New Issue
Block a user