Created
November 10, 2020 22:26
-
-
Save iloveicedgreentea/feecd7d47185b36caad58fed87fe4e41 to your computer and use it in GitHub Desktop.
example2
This file contains 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
FROM python:3.8-slim | |
# Update and install deps. Install packages the app needs and remove list cache to save space. Notice this is done in one layer | |
RUN apt-get update && apt-get upgrade -y && \ | |
apt-get install zip unzip -y && \ | |
rm -rf /var/lib/apt/lists/* | |
# Set a home directory specifically for this container | |
ENV WORKDIR="/app" | |
# Create the user, our app directory, and set the owner | |
RUN useradd -s /bin/bash --no-create-home app && mkdir -p ${WORKDIR} && chown -R app:app ${WORKDIR} | |
# run as app user | |
USER app | |
# set our relative directory to /app | |
WORKDIR ${WORKDIR} | |
# Copy app files | |
COPY --chown=app:app src/* ${WORKDIR}/ | |
# Set an entrypoint and cmd | |
ENTRYPOINT [ "some entrypoint script" ] | |
CMD [ "command to start" ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment