-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improvements to Dockerfile, docker-compose etc
- Loading branch information
1 parent
247f855
commit 0768251
Showing
6 changed files
with
49 additions
and
17 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# patterns matched in this file are excluded from the Dockerfile image build | ||
# This reduces image size and improves security | ||
|
||
.git | ||
.github | ||
.gitignore | ||
*.env |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,28 @@ | ||
# Base Docker image Official Python 3.10 | ||
FROM python:3.10 | ||
|
||
# Create & set working directory | ||
RUN mkdir -p /home/app/webapp | ||
WORKDIR /home/app/webapp | ||
|
||
# Set environment variables | ||
# Set 'build-time' environment variables | ||
ENV PYTHONDONTWRITEBYTECODE 1 | ||
ENV PYTHONUNBUFFERED 1 | ||
ENV PYTHONUNBUFFERED 1 | ||
|
||
# Add Development requirements | ||
COPY requirements/development-requirements.txt /app/requirements/development-requirements.txt | ||
COPY requirements/common-requirements.txt /app/requirements/common-requirements.txt | ||
|
||
# Set working directory for requirements installation | ||
WORKDIR /app/requirements/ | ||
|
||
# Run installation of requirements | ||
RUN pip install --upgrade pip | ||
RUN pip install -r /app/requirements/development-requirements.txt | ||
|
||
# Set working directory back to main app | ||
WORKDIR /app/ | ||
|
||
# Copy application code into image | ||
# (Excludes any files/dirs matched by patterns in .dockerignore) | ||
COPY . /app/ | ||
|
||
# Use port 8000 in development (may be overridden by docker-compose file) | ||
EXPOSE 8000 | ||
|
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
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
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