Skip to content

Commit

Permalink
Fix image_name for push and cleanup Dockerfile
Browse files Browse the repository at this point in the history
Signed-off-by: eternaltyro <230743+eternaltyro@users.noreply.github.com>
  • Loading branch information
eternaltyro committed May 17, 2024
1 parent cde1ca5 commit 64273c4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/ecs-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,9 @@ jobs:
- name: Parse build step metadata
id: parse-image-meta
run: |
echo $IMAGE_TAG
echo image=$( echo $BUILD_META | jq '."image.name"' )
image=$( echo $BUILD_META | jq '."image.name"' )
echo "image_name=${image}" >> $GITHUB_OUTPUT
env:
IMAGE_TAG: ${{ steps.meta.outputs.tags[0] }}
BUILD_META: ${{ steps.build-push-image.outputs.Metadata }}

deploy:
Expand Down Expand Up @@ -98,7 +96,6 @@ jobs:
task-definition: task-definition.json
container-name: ${{ env.CONTAINER_NAME }}
image: ${{ needs.build-push-image.outputs.image_name }}
# image: ${{ env.IMAGE_NAME }}:fastapi

- name: Deploy task definition
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
Expand Down
24 changes: 13 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ FROM base as extract-deps
RUN pip install --no-cache-dir --upgrade pip
WORKDIR /opt/python
COPY pyproject.toml pdm.lock README.md /opt/python/
RUN pip install --no-cache-dir pdm==2.7.4
RUN pip install --no-cache-dir pdm==2.8.0
RUN pdm export --prod --without-hashes > requirements.txt


Expand All @@ -34,13 +34,14 @@ FROM base as build
RUN pip install --no-cache-dir --upgrade pip
WORKDIR /opt/python
# Setup backend build-time dependencies
RUN apt-get update
RUN apt-get install --no-install-recommends -y build-essential
RUN apt-get install --no-install-recommends -y \
postgresql-server-dev-15 \
python3-dev \
libffi-dev \
libgeos-dev
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive \
apt-get install --no-install-recommends -y -q \
build-essential \
postgresql-server-dev-15 \
python3-dev \
libffi-dev \
libgeos-dev
# Setup backend Python dependencies
COPY --from=extract-deps \
/opt/python/requirements.txt /opt/python/
Expand All @@ -62,7 +63,8 @@ ENV PYTHONDONTWRITEBYTECODE=1 \
REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
# Setup backend runtime dependencies
RUN apt-get update && \
apt-get install --no-install-recommends -y \
DEBIAN_FRONTEND=noninteractive \
apt-get install --no-install-recommends -y -q \
postgresql-client libgeos3.11.1 proj-bin curl && \
apt-get clean && rm -rf /var/lib/apt/lists/*
COPY --from=build \
Expand All @@ -79,7 +81,7 @@ COPY manage.py .

FROM runtime as debug
RUN pip install --user --no-warn-script-location \
--no-cache-dir debugpy==1.6.7
--no-cache-dir debugpy==1.8.1
EXPOSE 5678/tcp
CMD ["python", "-m", "debugpy", "--wait-for-client", "--listen", "0.0.0.0:5678", \
"-m", "uvicorn", "backend.main:api", "--host", "0.0.0.0", "--port", "5000", \
Expand All @@ -94,4 +96,4 @@ RUN python -m compileall .
EXPOSE 5000/tcp
USER appuser:appuser
CMD ["uvicorn", "backend.main:api", "--host", "0.0.0.0", "--port", "5000", \
"--workers", "1", "--log-level", "error"]
"--log-level", "error"]

0 comments on commit 64273c4

Please sign in to comment.