mirror of
https://github.com/EthanPisani/ethanpisani.com.git
synced 2025-07-02 18:15:18 -04:00
Add Dockerfile and requirements.txt for containerization
This commit is contained in:
parent
b4289f7e19
commit
9fcdc7346b
32
Dockerfile
Normal file
32
Dockerfile
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
FROM python:3.9.18-slim-bookworm
|
||||||
|
|
||||||
|
# Set the working directory in the container
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Copy the dependencies file to the working directory
|
||||||
|
COPY requirements.txt .
|
||||||
|
|
||||||
|
# Install any dependencies
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get install -y gcc
|
||||||
|
|
||||||
|
RUN pip install --upgrade pip
|
||||||
|
|
||||||
|
RUN pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
|
# Copy the content of the local src directory to the working directory
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
# clean unneeded files
|
||||||
|
RUN rm -rf /root/.cache/pip
|
||||||
|
RUN rm -rf /var/lib/apt/lists/*
|
||||||
|
RUN rm -rf /var/cache/apt/*
|
||||||
|
|
||||||
|
|
||||||
|
# Command to run on container start
|
||||||
|
|
||||||
|
CMD [ "python", "./main.py" ]
|
||||||
|
|
||||||
|
# set port
|
||||||
|
EXPOSE 80
|
1
requirements.txt
Normal file
1
requirements.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
flask
|
Loading…
Reference in New Issue
Block a user