✨ Fixed Docker
This commit is contained in:
+4
-3
@@ -1,13 +1,14 @@
|
|||||||
FROM python:3.10-slim
|
FROM python:3.11-slim
|
||||||
|
|
||||||
COPY Pipfile* /app/
|
COPY Pipfile* /app/
|
||||||
WORKDIR /app/
|
WORKDIR /app/
|
||||||
RUN apt update && \
|
RUN apt update && \
|
||||||
apt install -y jq gcc libpq5 libpq-dev && \
|
apt install -y jq gcc libpq5 libpq-dev libmagic1 && \
|
||||||
jq -r '.default | to_entries[] | .key + .value.version' Pipfile.lock > requirements.txt && \
|
jq -r '.default | to_entries[] | .key + .value.version' Pipfile.lock > requirements.txt && \
|
||||||
sed -i "s/psycopg2-binary/psycopg2/g" requirements.txt
|
sed -i "s/psycopg2-binary/psycopg2/g" requirements.txt
|
||||||
|
|
||||||
RUN pip install -r requirements.txt
|
RUN pip install -r requirements.txt && \
|
||||||
|
apt remove -y jq gcc
|
||||||
|
|
||||||
COPY classquiz/ /app/classquiz/
|
COPY classquiz/ /app/classquiz/
|
||||||
COPY image_cleanup.py /app/image_cleanup.py
|
COPY image_cleanup.py /app/image_cleanup.py
|
||||||
|
|||||||
@@ -30,10 +30,8 @@ pillow = ">=9.1.1"
|
|||||||
authlib = "*"
|
authlib = "*"
|
||||||
httpx = "*"
|
httpx = "*"
|
||||||
itsdangerous = "*"
|
itsdangerous = "*"
|
||||||
puremagic = "*"
|
|
||||||
py-avataaars-no-png = "*"
|
py-avataaars-no-png = "*"
|
||||||
cryptography = "*"
|
cryptography = "*"
|
||||||
scheduler = "*"
|
|
||||||
webauthn = "*"
|
webauthn = "*"
|
||||||
pyotp = "*"
|
pyotp = "*"
|
||||||
minio = "*"
|
minio = "*"
|
||||||
@@ -60,3 +58,4 @@ python_version = "3.11"
|
|||||||
format = "black ."
|
format = "black ."
|
||||||
lint = "flake8 classquiz"
|
lint = "flake8 classquiz"
|
||||||
test = "coverage run -m pytest --lf -v --asyncio-mode=strict classquiz/tests"
|
test = "coverage run -m pytest --lf -v --asyncio-mode=strict classquiz/tests"
|
||||||
|
worker = "arq classquiz.worker.WorkerSettings"
|
||||||
|
|||||||
Generated
+4
-28
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"_meta": {
|
"_meta": {
|
||||||
"hash": {
|
"hash": {
|
||||||
"sha256": "14b53f70a0556b62779c7f2a76c7850c0e5477005a0e462c587b30a8eecbe4fb"
|
"sha256": "f10247b4d32925c62f8f9c99a6b3d3bf0073f630d09cf15a7df884f86b78b0a2"
|
||||||
},
|
},
|
||||||
"pipfile-spec": 6,
|
"pipfile-spec": 6,
|
||||||
"requires": {
|
"requires": {
|
||||||
@@ -564,11 +564,11 @@
|
|||||||
},
|
},
|
||||||
"fastapi": {
|
"fastapi": {
|
||||||
"hashes": [
|
"hashes": [
|
||||||
"sha256:22d773ce95f14f04f8f37a0c8998fc163e67af83b65510d2879de6cbaaa10215",
|
"sha256:95d757511c596409930bd20673358d4a4d709004edb85c5d24d6ffc48fabcbf2",
|
||||||
"sha256:5c1d243030e63089ccfc0aec69c2da6d619943917727e8e82ee502358d5119bf"
|
"sha256:b53248ee45f64f19bb7600953696e3edf94b0f7de94df1e5433fc5c6136fa986"
|
||||||
],
|
],
|
||||||
"index": "pypi",
|
"index": "pypi",
|
||||||
"version": "==0.96.1"
|
"version": "==0.97.0"
|
||||||
},
|
},
|
||||||
"frozenlist": {
|
"frozenlist": {
|
||||||
"hashes": [
|
"hashes": [
|
||||||
@@ -1230,14 +1230,6 @@
|
|||||||
],
|
],
|
||||||
"version": "==2.9.6"
|
"version": "==2.9.6"
|
||||||
},
|
},
|
||||||
"puremagic": {
|
|
||||||
"hashes": [
|
|
||||||
"sha256:349e179f04bcc14eb0e2c3941cd9ee4ea74881ab6ccac63ea0c37c98f7a80b22",
|
|
||||||
"sha256:6e46aa78113a466abc9f69e6e8a4ce90eb57d908dafb809597012621061462bd"
|
|
||||||
],
|
|
||||||
"index": "pypi",
|
|
||||||
"version": "==1.15"
|
|
||||||
},
|
|
||||||
"py-avataaars-no-png": {
|
"py-avataaars-no-png": {
|
||||||
"hashes": [
|
"hashes": [
|
||||||
"sha256:9cd593fe93d6e223626903da7310ad53e857b3fd856ce7e7f2b1faa401740054",
|
"sha256:9cd593fe93d6e223626903da7310ad53e857b3fd856ce7e7f2b1faa401740054",
|
||||||
@@ -1465,14 +1457,6 @@
|
|||||||
"markers": "python_version >= '3.6' and python_version < '4'",
|
"markers": "python_version >= '3.6' and python_version < '4'",
|
||||||
"version": "==4.9"
|
"version": "==4.9"
|
||||||
},
|
},
|
||||||
"scheduler": {
|
|
||||||
"hashes": [
|
|
||||||
"sha256:48e8fe16f4a0cbd24f169a2ed4f65b99fb0c3a7f4a28f4dfbf26cc901ab4112b",
|
|
||||||
"sha256:5ae5181d8462d89307bdae588b47f290a2fb7e3fa1073650354e01eb87a265f4"
|
|
||||||
],
|
|
||||||
"index": "pypi",
|
|
||||||
"version": "==0.8.4"
|
|
||||||
},
|
|
||||||
"sentry-sdk": {
|
"sentry-sdk": {
|
||||||
"hashes": [
|
"hashes": [
|
||||||
"sha256:79afb7c896014038e358401ad1d36889f97a129dfa8031c49b3f238cd1aa3935",
|
"sha256:79afb7c896014038e358401ad1d36889f97a129dfa8031c49b3f238cd1aa3935",
|
||||||
@@ -1575,14 +1559,6 @@
|
|||||||
"index": "pypi",
|
"index": "pypi",
|
||||||
"version": "==1.0.0"
|
"version": "==1.0.0"
|
||||||
},
|
},
|
||||||
"typeguard": {
|
|
||||||
"hashes": [
|
|
||||||
"sha256:194fb3dbcb06ea9caf7088f3befee014de57961689f9c859ac5239b1ef61d987",
|
|
||||||
"sha256:c4a40af0ba8a41077221271b46d0a6d8d46045443e4d887887c69254ca861952"
|
|
||||||
],
|
|
||||||
"markers": "python_full_version >= '3.7.4'",
|
|
||||||
"version": "==4.0.0"
|
|
||||||
},
|
|
||||||
"typer": {
|
"typer": {
|
||||||
"extras": [
|
"extras": [
|
||||||
"all"
|
"all"
|
||||||
|
|||||||
+13
-3
@@ -13,16 +13,17 @@ services:
|
|||||||
REDIS_URL: redis://redis:6379/0?decode_responses=True
|
REDIS_URL: redis://redis:6379/0?decode_responses=True
|
||||||
API_URL: http://api:80
|
API_URL: http://api:80
|
||||||
api:
|
api:
|
||||||
build:
|
build: &build_cfg
|
||||||
context: .
|
context: .
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
restart: always
|
restart: always
|
||||||
depends_on:
|
depends_on: &depends
|
||||||
- db
|
- db
|
||||||
- redis
|
- redis
|
||||||
|
|
||||||
environment:
|
environment: &env_vars
|
||||||
DB_URL: "postgresql://postgres:classquiz@db:5432/classquiz"
|
DB_URL: "postgresql://postgres:classquiz@db:5432/classquiz"
|
||||||
|
REDIS: "redis://redis:6379/0?decode_responses=True"
|
||||||
MAIL_ADDRESS: "email@email@email.email"
|
MAIL_ADDRESS: "email@email@email.email"
|
||||||
MAIL_PASSWORD: "PASSWORT"
|
MAIL_PASSWORD: "PASSWORT"
|
||||||
MAIL_USERNAME: "email@email@email.email"
|
MAIL_USERNAME: "email@email@email.email"
|
||||||
@@ -34,6 +35,8 @@ services:
|
|||||||
SKIP_EMAIL_VERIFICATION: True
|
SKIP_EMAIL_VERIFICATION: True
|
||||||
HCAPTCHA_KEY: "HCAPTCHA_PRIVATE_KEY"
|
HCAPTCHA_KEY: "HCAPTCHA_PRIVATE_KEY"
|
||||||
MEILISEARCH_URL: "http://meilisearch:7700"
|
MEILISEARCH_URL: "http://meilisearch:7700"
|
||||||
|
STORAGE_BACKEND: "local"
|
||||||
|
STORAGE_PATH: "/app/data"
|
||||||
redis:
|
redis:
|
||||||
image: redis:alpine
|
image: redis:alpine
|
||||||
restart: always
|
restart: always
|
||||||
@@ -67,6 +70,13 @@ services:
|
|||||||
MEILI_NO_ANALYTICS: true
|
MEILI_NO_ANALYTICS: true
|
||||||
volumes:
|
volumes:
|
||||||
- meilisearch-data:/data.ms
|
- meilisearch-data:/data.ms
|
||||||
|
worker:
|
||||||
|
build: *build_cfg
|
||||||
|
environment: *env_vars
|
||||||
|
depends_on: *depends
|
||||||
|
command: arq classquiz.worker.WorkerSettings
|
||||||
|
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
data:
|
data:
|
||||||
meilisearch-data:
|
meilisearch-data:
|
||||||
|
|||||||
+2
-2
@@ -22,7 +22,7 @@ COPY package*.json ./
|
|||||||
COPY pnpm-lock.yaml ./
|
COPY pnpm-lock.yaml ./
|
||||||
|
|
||||||
# run npm install in our local machine
|
# run npm install in our local machine
|
||||||
RUN corepack enable && corepack prepare pnpm@7.26.2 --activate && pnpm i
|
RUN corepack enable && corepack prepare pnpm@8.6.1 --activate && pnpm i
|
||||||
|
|
||||||
# copy the generated modules and all other files to the container
|
# copy the generated modules and all other files to the container
|
||||||
COPY . .
|
COPY . .
|
||||||
@@ -38,7 +38,7 @@ FROM node:19-bullseye-slim
|
|||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=builder /usr/src/app/package.json .
|
COPY --from=builder /usr/src/app/package.json .
|
||||||
COPY --from=builder /usr/src/app/pnpm-lock.yaml .
|
COPY --from=builder /usr/src/app/pnpm-lock.yaml .
|
||||||
RUN corepack enable && corepack prepare pnpm@7.26.2 --activate && pnpm i
|
RUN corepack enable && corepack prepare pnpm@8.6.1 --activate && pnpm i
|
||||||
# copy files from previous step
|
# copy files from previous step
|
||||||
COPY --from=builder /usr/src/app/build .
|
COPY --from=builder /usr/src/app/build .
|
||||||
COPY --from=builder /usr/src/app/node_modules ./node_modules
|
COPY --from=builder /usr/src/app/node_modules ./node_modules
|
||||||
|
|||||||
Reference in New Issue
Block a user