-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
50 lines (37 loc) · 1.44 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Use an official Python image as the base image
FROM python:3.11.4
# Set Environment Variables for locales
ENV LANG es_ES.UTF-8
ENV LANGUAGE es_ES:es
ENV LC_ALL es_ES.UTF-8
# Install locales into the Docker image and set it up
RUN apt-get clean && apt-get update && apt-get install -y locales
RUN locale-gen es_ES.UTF-8
RUN dpkg-reconfigure locales
# Set environment variables to avoid Python bytecode and buffering
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# Install system dependencies for your app
RUN apt-get update && \
apt-get install -y nodejs npm
# Create a directory for your application and set it as the working directory
RUN mkdir /code
WORKDIR /code
# Install Python dependencies
COPY requirements.txt /code/
RUN pip install --upgrade pip
RUN pip install -r requirements.txt
# Install Node.js and npm
RUN curl -sL https://deb.nodesource.com/setup_20.x | bash -
RUN apt-get install -y nodejs
# Copy the package.json and package-lock.json files to install npm dependencies
COPY package*.json /code/
RUN npm install
# Copy the rest of your Django application code
COPY . /code/
# Copy the Django secret key file into the container
COPY django_secrets.env /code/
# Expose the port your app runs on (you may need to adjust this to your Django settings)
EXPOSE 8000
# Start the application using the start.sh script and read the secret key from the file
CMD ["sh", "-c", "export $(cat /code/django_secrets.env | xargs) && /code/start.sh"]