Docker deployment: fix dockerfile

This commit is contained in:
vas3k
2022-03-29 11:03:15 +02:00
parent c6052332c1
commit e2721ff00e
4 changed files with 13 additions and 10 deletions

View File

@@ -1,20 +1,28 @@
FROM python:3.7-slim-buster FROM ubuntu:20.04
ENV MODE dev
ENV DEBIAN_FRONTEND=noninteractive
ARG requirements=requirements.txt ARG requirements=requirements.txt
ENV DEBIAN_FRONTEND noninteractive ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update \ RUN apt-get update \
&& apt-get dist-upgrade -y \
&& apt-get install --no-install-recommends -yq \ && apt-get install --no-install-recommends -yq \
python3 \
python3-pip \
gcc \ gcc \
libc-dev \ libc-dev \
libpq-dev \ libpq-dev \
make \ make \
cron \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
WORKDIR /app WORKDIR /app
COPY . /app
COPY etc/crontab /etc/crontab
RUN chmod 600 /etc/crontab
ADD . /app ADD . /app
RUN pip install --no-cache-dir -e . \ RUN pip install --no-cache-dir -e . \

View File

@@ -43,9 +43,6 @@ migrate: ## Migrate database to the latest version
mypy: ## Check types with mypy mypy: ## Check types with mypy
mypy $(PROJECT_NAME) mypy $(PROJECT_NAME)
run: ## Runs dev server
python3 manage.py runserver
telegram: telegram:
python3 setup_telegram.py python3 setup_telegram.py
@@ -66,6 +63,5 @@ test-requirements: ## Install requirements to run tests
lint \ lint \
migrate \ migrate \
mypy \ mypy \
run \
test-ci \ test-ci \
test-requirements test-requirements

View File

@@ -2,7 +2,7 @@ version: "3"
services: services:
app: &app app: &app
image: ghcr.io/vas3k/infomate:${GITHUB_SHA:-latest} image: ghcr.io/vas3k/infomate:${GITHUB_SHA:-latest}
command: make docker-run-production command: make docker-run-app
container_name: infomate_app container_name: infomate_app
environment: environment:
- MODE=production - MODE=production

View File

@@ -7,10 +7,9 @@ pillow==9.0.1
awesome-slugify>=1.6.5 awesome-slugify>=1.6.5
requests>=2.22.0 requests>=2.22.0
beautifulsoup4==4.6.2 beautifulsoup4==4.6.2
pyyaml==5.2 pyyaml==5.4
feedparser==6 feedparser==6
sentry-sdk==0.14.1 sentry-sdk==0.14.1
nltk==3.4.5 nltk==3.6.6
newspaper3k>=0.2.8 newspaper3k>=0.2.8
django-bleach==1.0.0 django-bleach==1.0.0