Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .devcontainer/.devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"name": "dune-sync development container",
"dockerComposeFile": "../docker-compose.yml",
"service": "app",
"features": {
"ghcr.io/devcontainers/features/python:latest": {
"installTools": false,
"version": "3.13"
}
},
"customizations": {
"jetbrains": {
"settings": {
"com.intellij:app:EditorSettings.is_ensure_newline_at_eof": true,
"com.intellij:app:GeneralSettings.searchInBackground": true,
"Git4Idea:app:Git-Application-Settings.myPathToGit": "/usr/bin/git",
"org.jetbrains.plugins.github:app:GithubSettings.clone_git_using_ssh": true,
"com.intellij:app:Vcs-Log-App-Settings.show_changes_from_parents": true,
}
},
"vscode": {
"extensions": [
"ms-python.python",
"ms-python.black-formatter",
"charliermarsh.ruff"
],
"settings": {
"python.defaultInterpreterPath": "/usr/local/bin/python",
"python.linting.enabled": true,
"python.linting.pylintEnabled": false,
"python.linting.ruffEnabled": true,
"python.formatting.provider": "black",
"editor.formatOnSave": true
}
}
},
"postCreateCommand": "poetry install --no-root",
"containerEnv": {
"PYTHONPATH": "../",
},
"remoteEnv": {
"PYTHONPATH": "../"
}
}
1 change: 1 addition & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
with:
context: .
file: Dockerfile
target: prod
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
33 changes: 26 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,30 @@
FROM python:3.13-alpine
# Base
FROM python:3.13-slim AS base

# Install system dependencies and poetry
RUN apt-get update && \
apt-get install -y --no-install-recommends curl bash git && \
pip install poetry && \
rm -rf /var/lib/apt/lists/*

RUN python -m pip install poetry
RUN mkdir /app
COPY src /app/src
COPY poetry.lock /app/poetry.lock
COPY pyproject.toml /app/pyproject.toml
WORKDIR /app
COPY src /app/src
COPY pyproject.toml poetry.lock* ./
RUN POETRY_VIRTUALENVS_CREATE=false python -m poetry install --no-dev

# Dev
FROM base AS dev
RUN POETRY_VIRTUALENVS_CREATE=false python -m poetry install

#CMD ["python", "-m", "src.main"]

# Prod
FROM python:3.13-alpine AS prod

COPY --from=base /app/src /app/src/
COPY --from=base /usr/local/lib/python3.13/site-packages /usr/local/lib/python3.13/site-packages

WORKDIR /app

USER 1000
ENTRYPOINT [ "python", "-m" , "src.main"]
ENTRYPOINT [ "/usr/local/bin/python", "-m" , "src.main"]
30 changes: 30 additions & 0 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Base
FROM python:3.13-slim AS base

# Install system dependencies and poetry
RUN apt-get update && \
apt-get install -y --no-install-recommends curl bash git && \
pip install poetry && \
rm -rf /var/lib/apt/lists/*

WORKDIR /app
COPY src /app/src
COPY pyproject.toml poetry.lock* ./
RUN POETRY_VIRTUALENVS_CREATE=false python -m poetry install --no-dev

# Dev
FROM base AS dev
RUN POETRY_VIRTUALENVS_CREATE=false python -m poetry install

CMD ["python", "-m", "src.main"]

# Prod
FROM python:3.13-alpine AS prod

COPY --from=base /app/src /app/src/
COPY --from=base /usr/local/lib/python3.13/site-packages /usr/local/lib/python3.13/site-packages

WORKDIR /app

USER 1000
ENTRYPOINT [ "/usr/local/bin/python", "-m" , "src.main"]
4 changes: 4 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ services:
networks:
- monitor-net
user: "1000"
app:
build:
dockerfile: Dockerfile
# target: base
volumes:
pg_data:
prometheus_data: { }
Expand Down
Loading
Loading