forked from hasgeek/funnel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
45 lines (31 loc) · 1.27 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
FROM python:3.9-slim-bullseye
RUN apt-get -y update
# install curl
RUN apt-get -y install curl
# get install script and pass it to execute:
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash
# and install node
RUN apt-get -y install nodejs git wget unzip build-essential make postgresql libpq-dev python-dev
# We don't want to run our application as root if it is not strictly necessary, even in a container.
# Create a user and a group called 'app' to run the processes.
# A system user is sufficient and we do not need a home.
RUN adduser --system --group --no-create-home app
# Make the directory the working directory for subsequent commands
WORKDIR app
# Place the application components in a dir below the root dir
COPY . /app/
RUN cd /app/funnel; make
# Install from the requirements.txt we copied above
COPY requirements.txt /tmp
RUN pip install -r requirements.txt
COPY . /tmp/myapp
RUN pip install /tmp/myapp
# Hand everything over to the 'app' user
RUN chown -R app:app /app
# Subsequent commands, either in this Dockerfile or in a
# docker-compose.yml, will run as user 'app'
USER app
# We are done with setting up the image.
# As this image is used for different
# purposes and processes no CMD or ENTRYPOINT is specified here,
# this is done in docker-compose.yml.