diff --git a/.ebignore b/.ebignore new file mode 100644 index 0000000..d5f667c --- /dev/null +++ b/.ebignore @@ -0,0 +1,3 @@ +docker-compose.yml +Dockerfile.dev +node_modules/ \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 6754ddb..558eb68 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,4 +14,10 @@ COPY ./requirements.txt . RUN pip install -r requirements.txt # Copy project -COPY . . \ No newline at end of file +COPY . . + +# Expose the port server is running on +EXPOSE 8000 + +# Start the server +CMD ["gunicorn", "core.wsgi:application", "--bind", "0.0.0.0:8000"] \ No newline at end of file diff --git a/Dockerfile.dev b/Dockerfile.dev new file mode 100644 index 0000000..1ab0c26 --- /dev/null +++ b/Dockerfile.dev @@ -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 . . \ No newline at end of file diff --git a/Dockerrun.aws.json b/Dockerrun.aws.json new file mode 100644 index 0000000..5440224 --- /dev/null +++ b/Dockerrun.aws.json @@ -0,0 +1,17 @@ +{ + "AWSEBDockerrunVersion": 2, + "containerDefinitions": [ + { + "name": "web", + "image": "drcbeatz/mastertheorem-aws:latest", + "essential": true, + "memory": 512, + "portMappings": [ + { + "hostPort": 80, + "containerPort": 8000 + } + ] + } + ] +} diff --git a/docker-compose.yml b/docker-compose.yml index 269268d..7b8c787 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,7 +3,9 @@ version: "3.9" services: web: - build: . + build: + context: . + dockerfile: Dockerfile.dev environment: - DJANGO_DEBUG=True - DJANGO_SECURE_SSL_REDIRECT=False