Skip to content

Commit

Permalink
Merge branch 'hotfix/dockerfile'
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBoatyMcBoatFace committed Oct 12, 2023
2 parents 8e0e8ba + c2dfc15 commit dfcd663
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 41 deletions.
44 changes: 16 additions & 28 deletions Dockerfile
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"]
13 changes: 0 additions & 13 deletions requirements.txt

This file was deleted.

0 comments on commit dfcd663

Please sign in to comment.