37 lines
1019 B
Docker
37 lines
1019 B
Docker
FROM python:3.9.1-slim-buster
|
|
|
|
RUN apt-get clean && \
|
|
apt-get update && \
|
|
apt-get install -y nginx smbclient default-libmysqlclient-dev \
|
|
gcc python3-cffi libcairo2 libpango-1.0-0 libpangocairo-1.0-0 \
|
|
libgdk-pixbuf2.0-0 libffi-dev shared-mime-info
|
|
|
|
# set environment variables
|
|
ENV PYTHONDONTWRITEBYTECODE 1
|
|
ENV PYTHONUNBUFFERED 1
|
|
|
|
RUN mkdir /cwebcomp
|
|
WORKDIR /cwebcomp
|
|
ADD . /cwebcomp/
|
|
# only add this next one if you have static files
|
|
RUN mkdir static
|
|
|
|
RUN pip install -r ../../requirements.txt
|
|
RUN python manage.py collectstatic
|
|
|
|
# only if you need celery
|
|
#RUN useradd -ms /bin/bash celery
|
|
#COPY broker/init.d_celeryd /etc/init.d/celeryd
|
|
#COPY broker/celeryd /etc/default/celeryd
|
|
|
|
# nginx config and script to be run
|
|
COPY nginx.conf /etc/nginx/sites-available/default
|
|
COPY start.sh /usr/local/bin/start.sh
|
|
|
|
# set proper file permissions
|
|
RUN chmod u+x /etc/init.d/celeryd && \
|
|
chmod u+x /etc/default/celeryd && \
|
|
chmod u+x /usr/local/bin/start.sh
|
|
|
|
EXPOSE 80
|
|
CMD ["/bin/bash", "-c", "start.sh"] |