forked from pbp-fasilkom-ui/django-pbp-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit introduces a basic container-based runtime by adding a Dockerfile. Related issue: pbp-fasilkom-ui#5
- Loading branch information
Showing
6 changed files
with
109 additions
and
5 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,78 @@ | ||
# Virtual environments | ||
.env | ||
.venv | ||
env/ | ||
venv/ | ||
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
|
||
# Python cache files | ||
__pycache__/ | ||
|
||
# SQLite database | ||
db.sqlite3 | ||
db.sqlite3-journal | ||
|
||
# User-uploaded media | ||
media | ||
|
||
# Collected static files | ||
staticfiles/ | ||
|
||
# Coverage | ||
.coverage | ||
.coverage.* | ||
coverage.* | ||
htmlcov/ | ||
|
||
# Chromedriver | ||
chromedriver | ||
chromedriver.exe | ||
|
||
### macOS ### | ||
# General | ||
.DS_Store | ||
.AppleDouble | ||
.LSOverride | ||
|
||
# Icon must end with two \r | ||
Icon | ||
|
||
# Thumbnails | ||
._* | ||
|
||
# Files that might appear in the root of a volume | ||
.DocumentRevisions-V100 | ||
.fseventsd | ||
.Spotlight-V100 | ||
.TemporaryItems | ||
.Trashes | ||
.VolumeIcon.icns | ||
.com.apple.timemachine.donotpresent | ||
|
||
# Directories potentially created on remote AFP share | ||
.AppleDB | ||
.AppleDesktop | ||
Network Trash Folder | ||
Temporary Items | ||
.apdisk | ||
|
||
### Windows ### | ||
# Windows thumbnail cache files | ||
Thumbs.db | ||
Thumbs.db:encryptable | ||
ehthumbs.db | ||
ehthumbs_vista.db | ||
|
||
# Dump file | ||
*.stackdump | ||
|
||
# Folder config file | ||
[Dd]esktop.ini | ||
|
||
# Recycle Bin used on file shares | ||
$RECYCLE.BIN/ | ||
|
||
# Windows shortcuts | ||
*.lnk |
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 |
---|---|---|
|
@@ -75,4 +75,4 @@ ehthumbs_vista.db | |
$RECYCLE.BIN/ | ||
|
||
# Windows shortcuts | ||
*.lnk | ||
*.lnk |
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 +1 @@ | ||
3.10.6 | ||
3.11.5 |
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,27 @@ | ||
# Use official Python container image | ||
FROM docker.io/library/python:3.11.5-alpine | ||
|
||
# Configure environment variables | ||
ENV PYTHONDONTWRITEBYTECODE=1 | ||
ENV PYTHONBUFFERED=1 | ||
|
||
# TODO: Configure environment variables required by Django project | ||
# e.g., database connection, parameterised configuration in settings.py | ||
|
||
# Set the active working directory in the container | ||
WORKDIR /app | ||
|
||
# Copy the requirements file into the container | ||
COPY requirements.txt . | ||
|
||
# Install the declared app dependencies | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
|
||
# Copy the source code files into the container | ||
COPY . . | ||
|
||
# Expose the port that the app will run on | ||
EXPOSE 8000 | ||
|
||
# Run the app | ||
CMD ["/bin/sh", "-c", "python manage.py migrate && gunicorn project_django.wsgi --log-file -"] |
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,2 +1 @@ | ||
release: python manage.py migrate | ||
web: gunicorn project_django.wsgi --log-file - | ||
web: python manage.py migrate && gunicorn project_django.wsgi --log-file - |
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 +1 @@ | ||
python-3.10.6 | ||
python-3.11.5 |