-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
45 lines (32 loc) · 1021 Bytes
/
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.10 as generate-openapi
WORKDIR /app
COPY pyproject.toml pyproject.toml
COPY README.md README.md
COPY estimenergy estimenergy
RUN pip3 install poetry
RUN poetry config virtualenvs.create false
RUN poetry install
RUN poetry run generate-openapi
FROM node:18.16.0-alpine as build-frontend
WORKDIR /app
COPY estimenergy-web/ .
COPY --from=generate-openapi /app/openapi.json openapi.json
RUN apk add --no-cache openjdk11
RUN npm install
RUN npm run generate-openapi -- -i openapi.json
RUN npm run build -- --configuration=production
FROM nginx/unit:1.29.1-python3.11
WORKDIR /app
COPY --from=build-frontend /app/dist/estimenergy-web estimenergy-web
COPY pyproject.toml pyproject.toml
COPY README.md README.md
COPY estimenergy estimenergy
COPY unit-config.json /docker-entrypoint.d/config.json
RUN pip3 install poetry
RUN poetry config virtualenvs.create false
RUN poetry install
RUN mkdir /config
RUN chown -R www-data:www-data /config
ENV CONFIG_PATH /config/config.yml
VOLUME /config
EXPOSE 12321