NONRTRIC-955: Fix unit test 404 issue
[sim/a1-interface.git] / near-rt-ric-simulator / Dockerfile
1 #  ============LICENSE_START===============================================
2 #  Copyright (C) 2021-2023 Nordix Foundation. All rights reserved.
3 #  Copyright (C) 2023 OpenInfra Foundation Europe. All rights reserved.
4 #  ========================================================================
5 #  Licensed under the Apache License, Version 2.0 (the "License");
6 #  you may not use this file except in compliance with the License.
7 #  You may obtain a copy of the License at
8 #
9 #       http://www.apache.org/licenses/LICENSE-2.0
10 #
11 #  Unless required by applicable law or agreed to in writing, software
12 #  distributed under the License is distributed on an "AS IS" BASIS,
13 #  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 #  See the License for the specific language governing permissions and
15 #  limitations under the License.
16 #  ============LICENSE_END=================================================
17 #
18
19 FROM alpine:3.17.3
20
21 RUN apk add --update --no-cache python3=3.10.13-r0 py3-pip nginx nginx-mod-http-lua
22
23 RUN pip3 install Flask==2.2.5 connexion[swagger-ui,flask]==2.14.2
24
25 WORKDIR /usr/src/app
26
27 COPY api api
28 COPY nginx.conf nginx.conf
29 COPY certificate /usr/src/app/cert
30 COPY src src
31
32 ARG user=nonrtric
33 ARG group=nonrtric
34
35 RUN addgroup $user && \
36     adduser -S -G $group $user
37 RUN chown -R $user:$group /usr/src/app
38 RUN chown -R $user:$group /var/log/nginx
39 RUN chown -R $user:$group /var/lib/nginx
40
41 RUN touch /var/run/nginx.pid
42 RUN chown -R $user:$group /var/run/nginx.pid
43
44 USER ${user}
45
46 RUN chmod +x src/start.sh
47 CMD src/start.sh ${A1_VERSION}