Skip to content

Commit

Permalink
add Dockerfile.dev and use with docker-compose.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
DrCBeatz committed Apr 1, 2024
1 parent f1b46a7 commit 7434e8f
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .ebignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
docker-compose.yml
Dockerfile.dev
node_modules/
8 changes: 7 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,10 @@ COPY ./requirements.txt .
RUN pip install -r requirements.txt

# Copy project
COPY . .
COPY . .

# Expose the port server is running on
EXPOSE 8000

# Start the server
CMD ["gunicorn", "core.wsgi:application", "--bind", "0.0.0.0:8000"]
17 changes: 17 additions & 0 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Dockerfile.dev

FROM python:3.10.4-slim-bullseye

ENV PIP_DISABLE_PIP_VERSION_CHECK 1
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

# Set work directory
WORKDIR /code

# Install dependencies
COPY ./requirements.txt .
RUN pip install -r requirements.txt

# Copy project
COPY . .
17 changes: 17 additions & 0 deletions Dockerrun.aws.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"AWSEBDockerrunVersion": 2,
"containerDefinitions": [
{
"name": "web",
"image": "drcbeatz/mastertheorem-aws:latest",
"essential": true,
"memory": 512,
"portMappings": [
{
"hostPort": 80,
"containerPort": 8000
}
]
}
]
}
4 changes: 3 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ version: "3.9"

services:
web:
build: .
build:
context: .
dockerfile: Dockerfile.dev
environment:
- DJANGO_DEBUG=True
- DJANGO_SECURE_SSL_REDIRECT=False
Expand Down

0 comments on commit 7434e8f

Please sign in to comment.