Last active
August 16, 2020 09:54
-
-
Save leozz37/616a4afd1f05eca12cc9aa888bfc8514 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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