Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

dockerfile for django project

FROM python:3.9-alpine3.13
LABEL mantainer="libcs.me"

ENV PYTHONBUFFERED 1
COPY ./requirements.txt /tmp/requirements.txt
COPY ./app /app
WORKDIR /app
EXPOSE 8000



RUN python -m venv /py && 
    /py/bin/pip install --upgrade pip && 
    /py/bin/pip install -r/tmp/requirements.txt && 
    rm -rf /tmp && 
    adduser 
    --disable-password 
    --no-create-home  
    django-user


ENV PATH="/py/bin:$PATH"

USER django-user
Comment

Dockerfile example for Django

FROM python:3.7

RUN mkdir /app

COPY requierments.txt /app/

WORKDIR /app

RUN pip install -r requierments.txt

COPY . /app/
Comment

PREVIOUS NEXT
Code Example
Python :: python file open try except error 
Python :: import argv python 
Python :: numpy delete column 
Python :: python grid 
Python :: change dictionary value python 
Python :: path in string python 
Python :: python define an array of dictonary 
Python :: python set remove multiple elements 
Python :: python regex inside quotes 
Python :: selenium get cookies python 
Python :: http server in python 
Python :: pandas map using two columns 
Python :: Write a Python program to count the number of lines in a text file. 
Python :: pandas crosstab 
Python :: python pygame how to start a game 
Python :: reshape wide to long in pandas 
Python :: python program to find largest number in a list 
Python :: python get first character of string 
Python :: wintp python manage.py createsuperuser 
Python :: python convert images to pdf 
Python :: dictionary indexing python 
Python :: numpy.ndarray to lsit 
Python :: pandas dict from row 
Python :: git help 
Python :: decode multipart/form-data python 
Python :: make a list in python 3 
Python :: read csv pandas 
Python :: apply a created function pandas 
Python :: pandas dataframe column based on another column 
Python :: asymmetric encryption python 
ADD CONTENT
Topic
Content
Source link
Name
2+7 =