-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: TheBoatyMcBoatFace <[email protected]>
- Loading branch information
1 parent
8e0e8ba
commit c2dfc15
Showing
2 changed files
with
16 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,22 @@ | ||
# Use an official Python runtime as a parent image | ||
# Use bullseye with Python pre-installed | ||
FROM python:3.9-bullseye | ||
# Use an official Python image | ||
FROM python:3.11-slim | ||
|
||
# Set the working directory to /app | ||
WORKDIR /app | ||
|
||
# Copy all the things... | ||
ADD . /app/ | ||
|
||
# Add essential packages and psycopg2 prerequisites then upgrade pip | ||
RUN apt-get update && apt-get install -y \ | ||
gcc \ | ||
python3-dev \ | ||
libpq-dev \ | ||
&& pip install --upgrade pip | ||
# Install Poetry | ||
RUN pip install --upgrade pip \ | ||
&& pip install poetry \ | ||
&& poetry config virtualenvs.create false | ||
|
||
# Install python packages and remove unnecessary packages | ||
RUN pip install --no-cache-dir -r requirements.txt \ | ||
&& apt-get autoremove -y gcc python3-dev \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Make Log file | ||
RUN mkdir -p /app/logs | ||
# Create and set working directory | ||
WORKDIR /app | ||
|
||
# Copy over the pyproject.toml and poetry.lock file to install dependencies | ||
COPY pyproject.toml poetry.lock* /app/ | ||
|
||
# Env Variables | ||
ENV APP_PORT=3000 | ||
# Install runtime dependencies using Poetry | ||
RUN poetry install --no-dev | ||
|
||
# Expose APP_PORT of the container to the outside | ||
EXPOSE $APP_PORT | ||
# Copy the rest of the code | ||
COPY . /app/ | ||
|
||
# Run the command to start things... | ||
CMD ["python", "app/main.py"] | ||
# Command to run the application | ||
CMD ["python3", "-m", "run"] |
This file was deleted.
Oops, something went wrong.