Skip to content

Commit 247e8f4

Browse files
committed
Added docker and docker-compose file
1 parent af47705 commit 247e8f4

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

Dockerfile

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
FROM python:3.10-slim
2+
3+
# Set the working directory in the container
4+
WORKDIR /app
5+
6+
# Copy the current directory contents into the container at /app
7+
COPY . /app
8+
9+
# Install any needed packages specified in requirements.txt
10+
RUN pip install --no-cache-dir -r requirements.txt
11+
12+
# Labels
13+
LABEL author="Adams Pierre David"
14+
LABEL maintainer="Adams Pierre David"
15+
LABEL version="1.0"
16+
LABEL description="Docker Image to test django-appointment package in a container."
17+
18+
# Make port 8000 available to the world outside this container
19+
EXPOSE 8000
20+
21+
# Define environment variable
22+
ENV NAME World
23+
24+
# Run migrations and collect static files
25+
RUN python manage.py makemigrations
26+
RUN python manage.py migrate
27+
28+
# Run the command to start uWSGI
29+
CMD ["uwsgi", "--http", ":8000", "--module", "django_appointment.wsgi"]

docker-compose.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
version: '3.8'
2+
3+
services:
4+
web:
5+
build: .
6+
command: python manage.py runserver 0.0.0.0:8000
7+
volumes:
8+
- .:/app
9+
ports:
10+
- "8000:8000"
11+
env_file:
12+
- .env
13+
14+
qcluster:
15+
build: .
16+
command: python manage.py qcluster
17+
volumes:
18+
- .:/app
19+
env_file:
20+
- .env

0 commit comments

Comments
 (0)