Fix dockerfile to reflect common image naming
[aai/gizmo.git] / src / main / docker / Dockerfile
1 FROM @aai.docker.namespace@/aai-common-@aai.base.image@:@aai.base.image.version@
2
3 ARG MICRO_HOME=/opt/app/crud-api
4 ARG BIN_HOME=$MICRO_HOME/bin
5 ARG USERS_HOME=/opt/aaihome
6
7 # AAI-2177: Change aai gizmo container processes to run as non-root on the host
8
9 #Note:The group id and user id used below (492382 & 341790 respectively) are chosen arbitarily based on assumption that
10 # these are not used elsewhere. Please see  https://jira.onap.org/browse/AAI-2172 for more background on this.
11
12 RUN mkdir -p $MICRO_HOME $USERS_HOME /logs \
13     && groupadd -g 492382 aaiadmin \
14     && useradd -r -u 341790  -g 492382 -ms /bin/sh -d $USERS_HOME/aaiadmin aaiadmin
15 WORKDIR $MICRO_HOME
16 COPY /maven/gizmo/ .
17 RUN chmod 755 $BIN_HOME/* \
18     && ln -snf /logs $MICRO_HOME/logs \
19     && chown -R aaiadmin:aaiadmin $MICRO_HOME /logs
20
21 USER aaiadmin
22
23 EXPOSE 9520 9520
24
25 CMD ["/opt/app/crud-api/bin/start.sh"]