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