Skip to content

Commit

Permalink
feat(Dockerfile): Moved to alpine
Browse files Browse the repository at this point in the history
  • Loading branch information
ravi0lii committed Jun 12, 2020
1 parent 49b2f9b commit 8728dbb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
16 changes: 5 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
FROM python:3.8.3-slim
FROM python:3.8.3-alpine

# Copy everything to the container and install utility packages
RUN apt-get update && \
apt-get install -y --no-install-recommends pipenv vim && \
RUN apk update && \
apk add --no-cache vim && \
mkdir -p /app/static
COPY . /app/
WORKDIR /app/

# Install everything that is needed
RUN apt-get autoremove && \
apt-get autoclean && \
buildDeps='gcc libmariadb-dev python3-dev' && \
apt-get install -y --no-install-recommends $buildDeps && \
RUN apk add --no-cache gcc mariadb-dev mariadb-client build-base python3-dev && \
pip install pipenv && \
pipenv lock --requirements > requirements.txt && \
pip install -r requirements.txt && \
apt purge -y --auto-remove $buildDeps && \
apt-get install -y libmariadb3 && \
chown -R www-data:www-data /app/ && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /root/.cache

VOLUME ["/app/static"]
Expand Down
1 change: 0 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ fi
# Collect static files
if [ -n "$DJANGO_COLLECTSTATIC" ] ; then
python manage.py collectstatic --settings carddeckserver.settings.prod --noinput
chown -R www-data:www-data /app/static/
fi

# Run the server
Expand Down

0 comments on commit 8728dbb

Please sign in to comment.