-
Notifications
You must be signed in to change notification settings - Fork 69
/
Copy pathDockerfile.dev
50 lines (35 loc) · 1.59 KB
/
Dockerfile.dev
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
# Development Dockerfile to be run from the docker-compose.yml (run: docker compose up)
FROM python:3.11-slim
ENV DEBIAN_FRONTEND=noninteractive
# Update package lists without signature verification to avoid "At least one invalid signature was encountered." on debian repos
RUN apt-get -o Acquire::Check-Valid-Until=false -o Acquire::AllowInsecureRepositories=true -o Acquire::AllowDowngradeToInsecureRepositories=true update
# make g++ gcc build-essential are needed for node-gyp
RUN apt-get install -y curl make g++ gcc build-essential git
RUN curl -sL https://deb.nodesource.com/setup_20.x -o nodesource_setup.sh
RUN bash ./nodesource_setup.sh
RUN apt-get install -y nodejs
RUN pip install aider-chat
ENV user=typedai
ENV homedir=/home/typedai/
RUN useradd --create-home -g users typedai
WORKDIR $homedir
RUN mkdir ".husky"
COPY .husky/install.mjs .husky/install.mjs
COPY package*.json ./
RUN npm install
# Install Angular dependencies and build Angular app
WORKDIR $homedir/frontend
COPY frontend/package*.json ./
RUN npm install
# Set work directory back to home
WORKDIR $homedir
# Switch to non-root user
USER $user
ENV NODE_ENV=production
# Needed to avoid the error "fatal: detected dubious ownership in repository at '/home/typedai'" when running git commands
# as the application files are owned by the root user so an agent (which runs as the typedai user) can't modify them.
RUN git config --global --add safe.directory /home/typedai
# In the frontend package.json the `ng serve` needs the arg --host 0.0.0.0 for it to be available from the host machine
EXPOSE 4200
EXPOSE 3000
CMD ["./bin/cmd-script"]