Dockerization #1

Merged
kirby merged 5 commits from dockerisation into main 2023-04-05 11:42:19 +02:00
100 changed files with 70 additions and 0 deletions
Showing only changes of commit f217b9d273 - Show all commits

34
Dockerfile Normal file
View File

@ -0,0 +1,34 @@
### DEV ENV ###
FROM python:3.9.16-slim-bullseye AS app_dev
ARG APP_UID=1000
ARG APP_GID=1000
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
COPY ./docker/scripts/entrypoint.sh /usr/local/bin/entrypoint
RUN chmod +x /usr/local/bin/entrypoint
WORKDIR /app/
RUN addgroup --system gunicorn --gid ${APP_GID} && adduser --uid ${APP_UID} --system --disabled-login --group gunicorn
RUN apt update && apt install -y netcat libmariadb-dev-compat libmariadb-dev mariadb-client gcc
RUN pip install --upgrade pip
COPY ./app/requirements.txt .
RUN pip install -r requirements.txt
COPY ./app/ .
COPY ./app/updatesdashboard/.env.dev ./updatesdashboard/.env
#ENTRYPOINT tail -f /dev/null
RUN python /app/manage.py makemigrations
RUN python /app/manage.py makemigrations dashboard
RUN python /app/manage.py collectstatic
RUN rm -f ./updatesdashboard/.env
ENTRYPOINT tail -f /dev/null
#ENTRYPOINT ["/usr/local/bin/gunicorn","/app/manage.py","updatesdashboard.wsgi:application"]

View File

Before

Width:  |  Height:  |  Size: 280 KiB

After

Width:  |  Height:  |  Size: 280 KiB

View File

Before

Width:  |  Height:  |  Size: 106 KiB

After

Width:  |  Height:  |  Size: 106 KiB

View File

Before

Width:  |  Height:  |  Size: 170 KiB

After

Width:  |  Height:  |  Size: 170 KiB

34
docker-compose.yml Normal file
View File

@ -0,0 +1,34 @@
version: '0.1'
services:
web:
container_name: updatesdashboard.front
build:
context: ./
target: app_dev
command: /usr/local/bin/gunicorn /app/manage.py
ports:
- "3000:80"
volumes:
- ./app/:/app/
env_file:
- ./app/updatesdashboard/.env.dev
networks:
- updates-dashboard-network
depends_on:
- mysql
mysql:
image: mysql:8.0
container_name: updatesdashboard.mysql
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: updates_dashboard
MYSQL_USER: updates_dashboard
MYSQL_PASSWORD: miengetBatheajOf
ports:
- "3306:3306"
networks:
- updates-dashboard-network
networks:
updates-dashboard-network:
driver: bridge

View File

@ -0,0 +1,2 @@
#!/bin/sh
until nc -vz $1 $2; do echo "Waiting for MySQL $1:$2..."; sleep 3; done;