squeaknode/Dockerfile
Jonathan Zernik f263dd60dd
Create main.yml (#554)
* Create main.yml

Add the yaml file for the github action

* Update main.yml

Try build and push docker image

* Update main.yml

Fix image tag

* Update main.yml

Specify platforms in docker build action

* Upgrade pip in dockerfile

* Pin version of grpcio in requirements.txt

* Install pip requirements with only-binary

* Change grpcio version

* Remove only-binary option for pip install

* Update main.yml

cache docker layers

* Update main.yml

Push version tags to dockerhub

* Update main.yml

export and import cache to local

* Update main.yml

Fix image name
2021-01-03 21:00:49 -08:00

45 lines
917 B
Docker

FROM python:3.8-slim-buster AS compile-image
WORKDIR /
RUN apt-get update && apt-get install -y libpq-dev gcc libffi-dev build-essential
RUN python -m venv /opt/venv
# Make sure we use the virtualenv:
ENV PATH="/opt/venv/bin:$PATH"
COPY requirements.txt /
RUN pip install --upgrade pip && \
pip install -r requirements.txt
WORKDIR /app
# Copy the source code.
COPY squeaknode ./squeaknode
COPY proto ./proto
COPY LICENSE MANIFEST.in README.md requirements.txt setup.cfg setup.py ./
RUN python3 setup.py install
FROM python:3.8-slim-buster
COPY --from=compile-image /opt/venv /opt/venv
RUN apt-get update && apt-get install -y libpq-dev
EXPOSE 8774
EXPOSE 8994
EXPOSE 18774
EXPOSE 18994
# Web server
EXPOSE 12994
# Make sure we use the virtualenv:
ENV PATH="/opt/venv/bin:$PATH"
# Copy the entrypoint script.
COPY "start-squeaknode.sh" .
RUN chmod +x start-squeaknode.sh
CMD ["./start-squeaknode.sh"]