24 lines
469 B
Docker
24 lines
469 B
Docker
FROM python:3-slim
|
|
|
|
RUN apt-get update \
|
|
&& apt-get -y install libpq-dev gcc \
|
|
&& pip install psycopg2
|
|
|
|
# install dependencies
|
|
COPY fetcher/requeriments.txt /srv
|
|
RUN pip3 install --no-cache-dir -r /srv/requeriments.txt
|
|
|
|
# copy all the files to the container
|
|
COPY static /srv/static
|
|
COPY fetcher /srv/fetcher
|
|
COPY fetch.py /srv
|
|
|
|
WORKDIR /srv
|
|
RUN useradd -m fetch
|
|
RUN chown -R fetch:fetch /srv
|
|
USER fetch
|
|
|
|
# run the command
|
|
ENTRYPOINT ["python"]
|
|
CMD ["fetch.py"]
|