File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ {
2+ "name" : " dune-sync development container" ,
3+ "dockerComposeFile" : " ../docker-compose.yml" ,
4+ "service" : " app" ,
5+ "features" : {
6+ "ghcr.io/devcontainers/features/python:latest" : {
7+ "installTools" : false ,
8+ "version" : " 3.13"
9+ }
10+ },
11+ "customizations" : {
12+ "jetbrains" : {
13+ "settings" : {
14+ "com.intellij:app:EditorSettings.is_ensure_newline_at_eof" : true ,
15+ "com.intellij:app:GeneralSettings.searchInBackground" : true ,
16+ "Git4Idea:app:Git-Application-Settings.myPathToGit" : " /usr/bin/git" ,
17+ "org.jetbrains.plugins.github:app:GithubSettings.clone_git_using_ssh" : true ,
18+ "com.intellij:app:Vcs-Log-App-Settings.show_changes_from_parents" : true ,
19+ }
20+ },
21+ "vscode" : {
22+ "extensions" : [
23+ " ms-python.python" ,
24+ " ms-python.black-formatter" ,
25+ " charliermarsh.ruff"
26+ ],
27+ "settings" : {
28+ "python.defaultInterpreterPath" : " /usr/local/bin/python" ,
29+ "python.linting.enabled" : true ,
30+ "python.linting.pylintEnabled" : false ,
31+ "python.linting.ruffEnabled" : true ,
32+ "python.formatting.provider" : " black" ,
33+ "editor.formatOnSave" : true
34+ }
35+ }
36+ },
37+ "postCreateCommand" : " poetry install --no-root" ,
38+ "containerEnv" : {
39+ "PYTHONPATH" : " ../" ,
40+ },
41+ "remoteEnv" : {
42+ "PYTHONPATH" : " ../"
43+ }
44+ }
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 3535 with :
3636 context : .
3737 file : Dockerfile
38+ target : prod
3839 push : true
3940 tags : ${{ steps.meta.outputs.tags }}
4041 labels : ${{ steps.meta.outputs.labels }}
Original file line number Diff line number Diff line change 1- FROM python:3.13-alpine
1+ # Base
2+ FROM python:3.13-slim AS base
3+
4+ # Install system dependencies and poetry
5+ RUN apt-get update && \
6+ apt-get install -y --no-install-recommends curl bash git && \
7+ pip install poetry && \
8+ rm -rf /var/lib/apt/lists/*
29
3- RUN python -m pip install poetry
4- RUN mkdir /app
5- RUN apk add bash
6- COPY src /app/src
7- COPY poetry.lock /app/poetry.lock
8- COPY pyproject.toml /app/pyproject.toml
910WORKDIR /app
11+ COPY src /app/src
12+ COPY pyproject.toml poetry.lock* ./
13+ RUN POETRY_VIRTUALENVS_CREATE=false python -m poetry install --no-dev
14+
15+ # Dev
16+ FROM base AS dev
1017RUN POETRY_VIRTUALENVS_CREATE=false python -m poetry install
18+
19+ # CMD ["python", "-m", "src.main"]
20+
21+ # Prod
22+ FROM python:3.13-alpine AS prod
23+
24+ COPY --from=base /app/src /app/src/
25+ COPY --from=base /usr/local/lib/python3.13/site-packages /usr/local/lib/python3.13/site-packages
26+
27+ WORKDIR /app
28+
1129USER 1000
12- ENTRYPOINT [ "python" , "-m" , "src.main" ]
30+ ENTRYPOINT [ "/usr/local/bin/ python" , "-m" , "src.main" ]
Original file line number Diff line number Diff line change 1+ # Base
2+ FROM python:3.13-slim AS base
3+
4+ # Install system dependencies and poetry
5+ RUN apt-get update && \
6+ apt-get install -y --no-install-recommends curl bash git && \
7+ pip install poetry && \
8+ rm -rf /var/lib/apt/lists/*
9+
10+ WORKDIR /app
11+ COPY src /app/src
12+ COPY pyproject.toml poetry.lock* ./
13+ RUN POETRY_VIRTUALENVS_CREATE=false python -m poetry install --no-dev
14+
15+ # Dev
16+ FROM base AS dev
17+ RUN POETRY_VIRTUALENVS_CREATE=false python -m poetry install
18+
19+ CMD ["python", "-m", "src.main"]
20+
21+ # Prod
22+ FROM python:3.13-alpine AS prod
23+
24+ COPY --from=base /app/src /app/src/
25+ COPY --from=base /usr/local/lib/python3.13/site-packages /usr/local/lib/python3.13/site-packages
26+
27+ WORKDIR /app
28+
29+ USER 1000
30+ ENTRYPOINT [ "/usr/local/bin/python", "-m" , "src.main"]
Original file line number Diff line number Diff line change @@ -53,6 +53,10 @@ services:
5353 networks :
5454 - monitor-net
5555 user : " 1000"
56+ app :
57+ build :
58+ dockerfile : Dockerfile
59+ # target: base
5660volumes :
5761 pg_data :
5862 prometheus_data : { }
You can’t perform that action at this time.
0 commit comments