monra commited on
Commit
e72b5ba
1 Parent(s): 84d9cf2

Update docker

Browse files
.github/workflows/docker-build-push.yml CHANGED
@@ -7,21 +7,22 @@ jobs:
7
  build-and-push:
8
  runs-on: ubuntu-latest
9
  steps:
 
10
  - name: Checkout code
11
  uses: actions/checkout@v2
12
- -
13
- # Add support for more platforms with QEMU (optional)
14
- # https://github.com/docker/setup-qemu-action
15
- name: Set up QEMU
16
  uses: docker/setup-qemu-action@v2
17
- -
18
- name: Set up Docker Buildx
19
  uses: docker/setup-buildx-action@v2
 
20
  - name: Login to Docker Hub
21
  uses: docker/login-action@v1
22
  with:
23
  username: ${{ secrets.DOCKER_USERNAME }}
24
  password: ${{ secrets.DOCKER_PASSWORD }}
 
25
  - name: Build and push Docker image
26
  uses: docker/build-push-action@v2
27
  with:
 
7
  build-and-push:
8
  runs-on: ubuntu-latest
9
  steps:
10
+
11
  - name: Checkout code
12
  uses: actions/checkout@v2
13
+
14
+ - name: Set up QEMU - Support for more platforms
 
 
15
  uses: docker/setup-qemu-action@v2
16
+
17
+ - name: Set up Docker Buildx
18
  uses: docker/setup-buildx-action@v2
19
+
20
  - name: Login to Docker Hub
21
  uses: docker/login-action@v1
22
  with:
23
  username: ${{ secrets.DOCKER_USERNAME }}
24
  password: ${{ secrets.DOCKER_PASSWORD }}
25
+
26
  - name: Build and push Docker image
27
  uses: docker/build-push-action@v2
28
  with:
Dockerfile CHANGED
@@ -1,23 +1,16 @@
1
- # Build stage
2
- FROM python:3.10-slim-buster AS build
3
-
4
- WORKDIR /app
5
-
6
  COPY requirements.txt requirements.txt
7
- RUN apt-get update && \
8
- apt-get install -y --no-install-recommends build-essential libffi-dev cmake libcurl4-openssl-dev && \
9
- pip3 install --user --no-cache-dir -r requirements.txt
10
-
11
- COPY . .
12
-
13
- # Production stage
14
- FROM python:3.10-slim-buster AS production
15
-
16
- WORKDIR /app
17
-
18
- COPY --from=build /root/.local /root/.local
19
- COPY . .
20
-
21
- ENV PATH=/root/.local/bin:$PATH
22
-
23
- CMD ["python3", "./run.py"]
 
1
+ FROM python:3.10-slim-buster
2
+
3
+ WORKDIR /app
4
+
 
5
  COPY requirements.txt requirements.txt
6
+
7
+ RUN python -m venv venv
8
+ ENV PATH="/app/venv/bin:$PATH"
9
+
10
+ RUN apt-get update && \
11
+ apt-get install -y --no-install-recommends build-essential libffi-dev cmake libcurl4-openssl-dev && \
12
+ pip3 install --no-cache-dir -r requirements.txt
13
+
14
+ COPY . .
15
+
16
+ CMD ["python3", "./run.py"]