Skip to content

Commit

Permalink
Optimize dockerfile and dockerignore
Browse files Browse the repository at this point in the history
  • Loading branch information
ldeluigi committed Nov 29, 2022
1 parent f7268a8 commit dec3b53
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
3 changes: 3 additions & 0 deletions backend/.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ docker-*.yml
Dockerfile
*.md
nginx/
__pycache__
./temp
*_data.json
7 changes: 2 additions & 5 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ RUN addgroup -S app && adduser -S app -G app
# create the appropriate directories
ENV HOME=/home/app
ENV APP_HOME=/home/app/web
RUN mkdir -p $APP_HOME/staticfiles
RUN mkdir -p $APP_HOME/staticfiles && chown -R app:app $APP_HOME
WORKDIR $APP_HOME

# install dependencies
Expand All @@ -57,10 +57,7 @@ COPY --from=builder /usr/src/app/requirements.txt .
RUN pip install --no-cache /wheels/*

# copy project
COPY . $APP_HOME

# chown all the files to the app user
RUN chown -R app:app $APP_HOME
COPY --chown=app:app . $APP_HOME

# change to the app user
USER app
Expand Down

0 comments on commit dec3b53

Please sign in to comment.