File size: 1,146 Bytes
35bccbf
 
 
 
 
 
b0e29a0
 
35bccbf
 
 
80bdcef
 
35bccbf
 
38cdd10
35bccbf
 
 
80bdcef
 
 
 
 
 
 
 
564aa00
d0f70fe
35bccbf
c45331f
35bccbf
d0f70fe
35bccbf
c45331f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Use a base image with the necessary tools
FROM ubuntu:20.04

# Set environment variables to non-interactive mode
ENV DEBIAN_FRONTEND=noninteractive

WORKDIR /app

# Install necessary packages
RUN apt-get update && \
    apt-get install -y \
    curl \
    gnupg \
    python3 \
    python3-pip \
    libpq-dev \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*

# Download and install skopeo
RUN curl -fsSL https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04/Release.key | gpg --dearmor -o /usr/share/keyrings/libcontainers-archive-keyring.gpg \
    && echo "deb [signed-by=/usr/share/keyrings/libcontainers-archive-keyring.gpg] https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04/ /" > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list \
    && apt-get update \
    && apt-get install -y skopeo \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*

RUN useradd -m -u 1000 user

# Install FastAPI and Uvicorn
RUN pip3 install fastapi uvicorn

COPY --chown=user . /app

CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]