You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.0 KiB
45 lines
1.0 KiB
# stage 1
|
|
FROM python:3.8-slim-buster as backend-build
|
|
|
|
VOLUME /app
|
|
WORKDIR /app
|
|
|
|
RUN apt-get update \
|
|
&& apt-get -y install python3-dev \
|
|
&& apt-get -y install build-essential
|
|
|
|
RUN python3 -m venv /opt/venv
|
|
|
|
COPY . .
|
|
|
|
RUN . /opt/venv/bin/activate \
|
|
&& pip install --upgrade setuptools wheel \
|
|
&& pip install -r requirements.txt \
|
|
&& python setup.py sdist bdist_wheel \
|
|
&& pip install monsun_backend --no-index --find-links file:///app/dist
|
|
|
|
# stage 2
|
|
FROM python:3.8-slim-buster
|
|
|
|
RUN apt-get update \
|
|
&& apt-get -y install nginx \
|
|
&& apt-get -y install python3-dev \
|
|
&& apt-get -y install build-essential \
|
|
&& apt-get -qy install netcat
|
|
|
|
RUN mkdir /var/config
|
|
VOLUME /var/config
|
|
|
|
VOLUME /app
|
|
WORKDIR /app
|
|
|
|
COPY docker-entrypoint.sh /app/docker-entrypoint.sh
|
|
COPY wait-for-it.sh /app/wait-for-it.sh
|
|
COPY wsgi.py /app/wsgi.py
|
|
COPY nginx.conf /etc/nginx
|
|
COPY uwsgi.ini /app/uwsgi.ini
|
|
COPY migrations /app/migrations
|
|
|
|
COPY --from=backend-build /opt/venv /opt/venv
|
|
|
|
CMD ["bash", "./docker-entrypoint.sh"]
|
|
|