forked from citizensense/airsift3
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
49 lines (38 loc) · 1.54 KB
/
Dockerfile
File metadata and controls
49 lines (38 loc) · 1.54 KB
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
FROM python:3.8-slim-bullseye
ENV PYTHONUNBUFFERED 1
RUN apt-get update \
# dependencies for building Python packages
&& apt-get install -y build-essential \
# psycopg2 dependencies
&& apt-get install -y libpq-dev \
# Gis dependencies
&& apt-get install -y binutils libproj-dev gdal-bin \
# Translations dependencies
&& apt-get install -y gettext \
# Build dependencies
&& apt-get install -y curl gnupg \
&& curl -fsSL https://deb.nodesource.com/setup_16.x | bash - \
&& curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor -o /usr/share/keyrings/yarn-archive-keyring.gpg \
&& echo "deb [signed-by=/usr/share/keyrings/yarn-archive-keyring.gpg] https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
&& apt-get update \
&& apt-get install -y nodejs yarn \
# cleaning up unused files
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
&& rm -rf /var/lib/apt/lists/*
# Requirements are installed here to ensure they will be cached.
COPY ./requirements /requirements
RUN pip install --no-cache-dir -r /requirements/production.txt \
&& rm -rf /requirements
# Copy package files and install frontend dependencies
COPY package.json /app/
COPY yarn.lock /app/
RUN cd /app && yarn
# Copy application code
COPY . /app
# Build frontend assets and remove node_modules to reduce image size
RUN cd /app && yarn build && rm -rf node_modules
WORKDIR /app
# Expose default port (Render will use PORT env var)
EXPOSE 10000
# Run the start script
CMD ["/app/start.sh"]