blob: 0c52dc9630a9c23ad35c50ec8059777100d4a81f [file] [log] [blame]
maximesson6e119492020-03-12 17:24:41 +01001# ============LICENSE_START===============================================
BjornMagnussonXAe3883d02023-04-11 14:16:52 +02002# Copyright (C) 2021-2023 Nordix Foundation. All rights reserved.
rohithrajneeshf13ce012023-11-24 16:00:36 +00003# Copyright (C) 2023 OpenInfra Foundation Europe. All rights reserved.
maximesson6e119492020-03-12 17:24:41 +01004# ========================================================================
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
maximesson31525442020-03-20 16:20:57 +01008#
maximesson6e119492020-03-12 17:24:41 +01009# http://www.apache.org/licenses/LICENSE-2.0
maximesson31525442020-03-20 16:20:57 +010010#
maximesson6e119492020-03-12 17:24:41 +010011# 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
BjornMagnussonXAe3883d02023-04-11 14:16:52 +020019FROM alpine:3.17.3
maximesson6e119492020-03-12 17:24:41 +010020
rohithrajneeshf13ce012023-11-24 16:00:36 +000021RUN apk add --update --no-cache python3=3.10.13-r0 py3-pip nginx nginx-mod-http-lua
BjornMagnussonXA21be2e02020-03-25 09:37:14 +010022
rohithrajneeshf13ce012023-11-24 16:00:36 +000023RUN pip3 install Flask==2.2.5 connexion[swagger-ui,flask,uvicorn]
ecaiyanlinux9ab67f52020-05-14 15:11:45 +020024
BjornMagnussonXA24ee2702021-09-30 08:43:45 +020025WORKDIR /usr/src/app
ecaiyanlinux9ab67f52020-05-14 15:11:45 +020026
BjornMagnussonXA21be2e02020-03-25 09:37:14 +010027COPY api api
ecaiyanlinux9ab67f52020-05-14 15:11:45 +020028COPY nginx.conf nginx.conf
ecaiyanlinuxaf8d73d2020-05-20 11:17:33 +020029COPY certificate /usr/src/app/cert
BjornMagnussonXA24ee2702021-09-30 08:43:45 +020030COPY src src
BjornMagnussonXA21be2e02020-03-25 09:37:14 +010031
ecaiyanlinux6cad5d92022-01-12 12:10:04 +010032ARG user=nonrtric
33ARG group=nonrtric
34
BjornMagnussonXAe3883d02023-04-11 14:16:52 +020035RUN addgroup $user && \
36 adduser -S -G $group $user
ecaiyanlinux6cad5d92022-01-12 12:10:04 +010037RUN chown -R $user:$group /usr/src/app
38RUN chown -R $user:$group /var/log/nginx
39RUN chown -R $user:$group /var/lib/nginx
BjornMagnussonXAe3883d02023-04-11 14:16:52 +020040
ecaiyanlinux6cad5d92022-01-12 12:10:04 +010041RUN touch /var/run/nginx.pid
42RUN chown -R $user:$group /var/run/nginx.pid
43
44USER ${user}
45
ecaiyanlinux9ab67f52020-05-14 15:11:45 +020046RUN chmod +x src/start.sh
BjornMagnussonXA21be2e02020-03-25 09:37:14 +010047CMD src/start.sh ${A1_VERSION}