Skip to content

Instantly share code, notes, and snippets.

@leozz37
Last active August 16, 2020 09:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leozz37/616a4afd1f05eca12cc9aa888bfc8514 to your computer and use it in GitHub Desktop.
Save leozz37/616a4afd1f05eca12cc9aa888bfc8514 to your computer and use it in GitHub Desktop.
version: "3.8"
services:
app:
build: .
command: sh -c "python main.py"
# Replace "YOUR_USER" for your Docker Hub user
image: YOUR_USER/cicd-example:latest
ports:
- "80:8000"
# Python Alpine is a lightweighted version of Python
FROM python:3.8-alpine
# Installing dependencies
COPY ./requirements.txt ./requirements.txt
RUN pip install -r /requirements.txt
# Copying the source code to
RUN mkdir /app
WORKDIR /app
COPY ./app /app
# Creating and logging a user
RUN adduser -D user
USER user
# Commands for Docker run
EXPOSE 8000
CMD ["python", "main.py"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment