Skip to content
Snippets Groups Projects
Commit acbb009e authored by francisc.mendonca's avatar francisc.mendonca
Browse files

Dockerfiles - NOT TESTED!!!!

parent 3af959bb
No related branches found
No related tags found
No related merge requests found
File moved
SWTICH_ACCESS_KEY_ID=4406dbe746a24614a9bc8f7ec864e59f
SWITCH_SECRET_ACCESS_KEY=cec6e60954b24a51923fe5aaea9fbb3b
SWTICH_ENDPOINT_URL=https://os.zhdk.cloud.switch.ch
S3_BUCKET_NAME=cloud-bach-proj
\ No newline at end of file
File moved
flask
flask-cors
boto3
python-dotenv
\ No newline at end of file
Flask==2.0.1
Werkzeug==2.0.1
\ No newline at end of file
# Use Python 3.11 slim image as base
FROM python:3.11-slim
# Set working directory
WORKDIR /app
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
FLASK_APP=backend/main.py \
FLASK_ENV=development
# Install system dependencies
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
gcc \
python3-dev \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first to leverage Docker cache
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy the rest of the application
COPY . .
# Create a non-root user and switch to it
RUN useradd -m appuser && chown -R appuser:appuser /app
USER appuser
# Expose the port the app runs on
EXPOSE 8000
# Command to run the application
CMD ["python3", "backend/main.py"]
\ No newline at end of file
# Use Python 3.9 slim image as base
FROM python:3.9-slim
# Set working directory in container
WORKDIR /app
# Copy requirements first to leverage Docker cache
COPY requirements.txt .
# Install dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy the rest of the application
COPY . .
# Create a non-root user for security
RUN useradd -m myuser
USER myuser
# Expose the port the app runs on
EXPOSE 3000
# Command to run the application
CMD ["python", "main.py"]
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment