Skip to content

Commit

Permalink
build: Simplified dockerfile, removed cache id
Browse files Browse the repository at this point in the history
  • Loading branch information
RamiAwar committed Jan 23, 2025
1 parent a80f5b9 commit f91d872
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ COPY frontend/ .
# Temporary setup - need local env as the 'production' build is landing page only
ARG API_URL="/"

# Used for railway builds
ARG SERVICE_ID="1"

ENV VITE_API_URL=$API_URL
ENV NODE_ENV=local
RUN npm run build
Expand All @@ -44,22 +41,19 @@ WORKDIR /home/dataline/backend
# set env variables
ENV PYTHONDONTWRITEBYTECODE 1

Check warning on line 42 in Dockerfile

View workflow job for this annotation

GitHub Actions / build (linux/amd64)

Legacy key/value format with whitespace separator should not be used

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format More info: https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/
ENV PYTHONUNBUFFERED 1

Check warning on line 43 in Dockerfile

View workflow job for this annotation

GitHub Actions / build (linux/amd64)

Legacy key/value format with whitespace separator should not be used

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format More info: https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/
ENV UV_COMPILE_BYTECODE=1

# Install postgres connector dependencies
RUN apt update && apt install --no-install-recommends libpq5 -y

RUN mkdir -p /home/dataline/backend

# Temporarily use uv command from remote image to install dependencies
# https://docs.astral.sh/uv/guides/integration/docker/#non-editable-installs
# Install uv
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/

# Mount the lock and pyproject.toml to speed up image build time if these files are not changed
# Cache ID follows railway structure
# https://docs.railway.com/guides/dockerfiles#cache-mounts
RUN --mount=from=ghcr.io/astral-sh/uv,source=/uv,target=/bin/uv \
--mount=type=cache,id=s/${SERVICE_ID}-/root/.cache/uv,target=/root/.cache/uv \
--mount=type=bind,source=backend/uv.lock,target=uv.lock \
--mount=type=bind,source=backend/pyproject.toml,target=pyproject.toml \
uv sync --no-dev --frozen --no-install-project
COPY backend/uv.lock backend/pyproject.toml ./
RUN uv sync --no-dev --frozen --no-install-project --compile-bytecode


ENV PATH="/home/dataline/backend/.venv/bin:$PATH"
Expand Down

0 comments on commit f91d872

Please sign in to comment.