Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

Commit

Permalink
Update docker
Browse files Browse the repository at this point in the history
  • Loading branch information
ramon-victor committed Jul 14, 2023
1 parent 84d9cf2 commit e72b5ba
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 28 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/docker-build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,22 @@ jobs:
build-and-push:
runs-on: ubuntu-latest
steps:

- name: Checkout code
uses: actions/checkout@v2
-
# Add support for more platforms with QEMU (optional)
# https://github.com/docker/setup-qemu-action
name: Set up QEMU

- name: Set up QEMU - Support for more platforms
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
Expand Down
37 changes: 15 additions & 22 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
# Build stage
FROM python:3.10-slim-buster AS build

WORKDIR /app

FROM python:3.10-slim-buster

WORKDIR /app

COPY requirements.txt requirements.txt
RUN apt-get update && \
apt-get install -y --no-install-recommends build-essential libffi-dev cmake libcurl4-openssl-dev && \
pip3 install --user --no-cache-dir -r requirements.txt

COPY . .

# Production stage
FROM python:3.10-slim-buster AS production

WORKDIR /app

COPY --from=build /root/.local /root/.local
COPY . .

ENV PATH=/root/.local/bin:$PATH

CMD ["python3", "./run.py"]

RUN python -m venv venv
ENV PATH="/app/venv/bin:$PATH"

RUN apt-get update && \
apt-get install -y --no-install-recommends build-essential libffi-dev cmake libcurl4-openssl-dev && \
pip3 install --no-cache-dir -r requirements.txt

COPY . .

CMD ["python3", "./run.py"]

0 comments on commit e72b5ba

Please sign in to comment.