Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smaller python docker images #297

Open
uniquejava opened this issue Apr 15, 2020 · 0 comments
Open

Smaller python docker images #297

uniquejava opened this issue Apr 15, 2020 · 0 comments

Comments

@uniquejava
Copy link
Owner

https://pythonspeed.com/articles/smaller-python-docker-images/

#
# docker build --rm -t awesome .
# docker run --name awesome1 --link=db2inst1:db2inst1 -p 3000:3000 -dt awesome
#
FROM python:3.7-slim

RUN apt-get update && \
  apt-get install -y gcc libxml2 && \
  apt-get clean

WORKDIR /app

# We copy just the requirements.txt first to leverage Docker cache
COPY server/requirements.txt /app
RUN pip install -r requirements.txt

COPY server /app

ENV PORT 3000
EXPOSE 3000

USER root
CMD python server.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant