Skip to content

Commit

Permalink
chore: update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
ninoseki committed Mar 16, 2024
1 parent 67d6248 commit c8bccde
Show file tree
Hide file tree
Showing 11 changed files with 3,119 additions and 2,315 deletions.
14 changes: 4 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,23 @@ jobs:
strategy:
matrix:
python-version: ["3.11"]
poetry-version: [1.6.1]

poetry-version: [1.8.2]
steps:
- uses: actions/checkout@v3

- uses: actions/checkout@v4
- name: Setup poetry
uses: abatilo/actions-poetry@v2
uses: abatilo/actions-poetry@v3
with:
poetry-version: ${{ matrix.poetry-version }}

- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "poetry"

- name: Install dependencies
run: poetry install

- name: Run tests
run: |
mkdir -p frontend/dist/assets
poetry run pytest --cov=app
- name: Coveralls
env:
COVERALLS_PARALLEL: true
Expand Down
48 changes: 29 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,32 +1,42 @@
# build env
FROM node:20-alpine as build
# Frontend
FROM node:20-alpine3.18 as frontend

COPY ./frontend /frontend
WORKDIR /usr/src/app

WORKDIR /frontend
COPY ./frontend ./frontend

RUN npm install \
&& npm run build \
&& rm -rf node_modules
WORKDIR /usr/src/app/frontend

# prod env
FROM python:3.11-alpine
RUN npm install && npm run build && rm -rf node_modules

RUN apk --no-cache add whois build-base libffi-dev
# Backend
FROM python:3.11-slim-bookworm as backend

WORKDIR /usr/src/app
RUN apt-get update \
&& apt-get install -y --no-install-recommends build-essential \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

COPY pyproject.toml poetry.lock requirements.txt ./
COPY gunicorn.conf.py ./
COPY backend ./backend
COPY requirements.txt ./

RUN pip install --no-cache-dir -r requirements.txt

COPY pyproject.toml poetry.lock ./

RUN pip install --no-cache-dir -r requirements.txt \
&& poetry config virtualenvs.create false \
&& poetry install --without dev
RUN poetry config virtualenvs.create false \
&& poetry install --no-root --without dev

COPY --from=build /frontend ./frontend
# Main
FROM python:3.11-slim-bookworm

ENV PORT 8000
COPY --from=backend /usr/local/lib/python3.11/site-packages/ /usr/local/lib/python3.11/site-packages/
COPY --from=backend /usr/local/bin/ /usr/local/bin/

WORKDIR /usr/src/app

COPY gunicorn.conf.py ./
COPY backend ./backend
COPY --from=frontend /usr/src/app/frontend ./frontend

EXPOSE $PORT

Expand Down
5 changes: 4 additions & 1 deletion backend/core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

from starlette.config import Config

config = Config(".env")
try:
config = Config(".env")
except Exception:
config = Config()

PROJECT_NAME: str = config("PROJECT_NAME", default="shimon")

Expand Down
2 changes: 1 addition & 1 deletion frontend/env.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// <reference types="vite/client" />

interface ImportMeta {
readonly env: ImportMetaEnv;
readonly env: ImportMetaEnv
}
Loading

0 comments on commit c8bccde

Please sign in to comment.