Skip to content

Commit

Permalink
Merge tag 'dockerfile' into develop
Browse files Browse the repository at this point in the history
docker-fixes

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCAAdFiEEzCWiXNVAoenhbhfnr6OQJnuP21MFAmUoQSkACgkQr6OQJnuP
# 21PSIQ/+M/yrmmaE/GjZbMRRfXhjSl22b1jwFLtLXHf606xBT1inWq5t8cYns+eX
# icIdkSd08YHvuivykXEcdIIy6cjWxQS4lSNpHdMhlysP789153aaCGIWCajmq3Ok
# WbTaaWGI5zNWrFyLcDpN00DFpGMUYnx4ZBKK8j3EwN+i+O2874NwZI8EW/7b+v+6
# SNoimVJ69ngdiqK+54KVOcYFjPmDlS5LVVAJ+1LniPRtVKidn2gkwPwqLJ+2XOP9
# wonESUh95/Lk4vAXbejwQw25kNdKRhJyXfNXO980GKv/QDB+QKeVh3zyPWcr72ds
# x+JEekBm6TLyZT6LOFmwoSrU/aLbeZQ91iK3RaHhhh1JsKwWyBsYt0IFqv7S5pLr
# y53vzWjjOkYpb0Ma4bsv06U9QEC8ke21RRc0uJ30GbhPbbrfz5f8eC+PwbNQB+iq
# ruk/XcxKqzZlmd6t5RGr9ICnmQVBlP3ucHjlJ/z5gLWzy2XHUszURoYP5eE/wq1g
# L6PMdYPMsvg7siDMoE0+87V3PKq8UJ/QRInBsbkzc9SHrgO8bFyTjhqC7KZZ1eSh
# mwCEyhDujxq4iMjGqUeOtAYtlmaR97+eqDJdkfiPo0CECxSd3gwsvs/mMQUPRiB1
# hrSp5YmimDjNw6P60dcxWpeuCQQohxNP3TvO1BtmB+uukdPTgOo=
# =Gj3t
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu Oct 12 14:55:37 2023 EDT
# gpg:                using RSA key CC25A25CD540A1E9E16E17E7AFA390267B8FDB53
# gpg: Good signature from "Bentley Hensel (TheBoatyMcBoatFace | BentleyHensel.com) <[email protected]>" [ultimate]
  • Loading branch information
TheBoatyMcBoatFace committed Oct 12, 2023
2 parents ea13a75 + dfcd663 commit e21022b
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 e21022b

Please sign in to comment.