Skip to content
Snippets Groups Projects
Commit f8314620 authored by Antoine Gaudron-Desjardins's avatar Antoine Gaudron-Desjardins
Browse files

add docker-compose

parent ff8a1329
Branches
No related tags found
1 merge request!2Back
FROM python:3.9 AS build
## virtualenv
RUN python3 -m venv /venv
ENV PATH="/venv/bin:$PATH"
## add and install requirements
RUN pip install --upgrade pip && pip install pip-tools
COPY ./requirements.txt ./
RUN pip install -r requirements.txt
FROM python:3.9 AS runtime
EXPOSE 80
ENV PATH="/venv/bin:$PATH"
COPY --from=build /venv /venv
WORKDIR /backend
COPY . .
ENTRYPOINT ["python3", "main.py"]
\ No newline at end of file
...@@ -9,3 +9,17 @@ services: ...@@ -9,3 +9,17 @@ services:
command: ["mysqld", "--authentication-policy=mysql_native_password"] command: ["mysqld", "--authentication-policy=mysql_native_password"]
ports: ports:
- "3306:3306" - "3306:3306"
app:
container_name: "app"
build: .
depends_on:
- db
restart: always
ports:
- 8000:80
env_file: .env
environment:
DB_HOST: db
links:
- db
\ No newline at end of file
...@@ -12,3 +12,6 @@ sniffio==1.2.0 ...@@ -12,3 +12,6 @@ sniffio==1.2.0
starlette==0.19.1 starlette==0.19.1
typing-extensions==4.2.0 typing-extensions==4.2.0
uvicorn==0.17.6 uvicorn==0.17.6
SQLAlchemy==1.4.19
python-dotenv==0.18.0
PyMySQL==1.0.2
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment