Skip to content

Commit 870246a

Browse files
committed
Update Shipyard Dockerfiles
1 parent 2fb32e1 commit 870246a

4 files changed

Lines changed: 54 additions & 6 deletions

File tree

shipyard/Dockerfile

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,11 @@ FROM ubuntu:16.04
1717
ENV DEBIAN_FRONTEND noninteractive
1818
ENV container docker
1919

20-
RUN apt -qq update && \
21-
apt -y install \
20+
# Shipyard
21+
ARG SHIPYARD_HOME=/home/shipyard
22+
23+
RUN apt-get -qq update && \
24+
apt-get -y install \
2225
git \
2326
curl \
2427
netcat \
@@ -40,7 +43,7 @@ RUN apt -qq update && \
4043
&& pip install uwsgi \
4144
&& pip install configparser \
4245
&& pip install python-openstackclient==3.11.0 \
43-
&& apt clean \
46+
&& apt-get clean \
4447
&& rm -rf \
4548
/var/lib/apt/lists/* \
4649
/tmp/* \
@@ -49,11 +52,29 @@ RUN apt -qq update && \
4952
/usr/share/doc \
5053
/usr/share/doc-base
5154

52-
RUN git clone https://github.com/att-comdev/shipyard.git /home/ubuntu/shipyard
55+
# Create shipyard user
56+
RUN useradd -ms /bin/bash shipyard
57+
58+
# Clone the shipyard repository
59+
RUN git clone https://github.com/att-comdev/shipyard.git ${SHIPYARD_HOME}/shipyard
60+
61+
# Copy entrypoint.sh to /home/shipyard
62+
COPY entrypoint.sh ${SHIPYARD_HOME}/entrypoint.sh
5363

54-
WORKDIR /home/ubuntu/shipyard
64+
# Copy shipyard.conf to /home/shipyard
65+
COPY shipyard.conf ${SHIPYARD_HOME}/shipyard.conf
5566

67+
# Change permissions
68+
RUN chown -R shipyard: ${SHIPYARD_HOME} \
69+
&& chmod +x ${SHIPYARD_HOME}/entrypoint.sh
70+
71+
# Expose port 9000 for application
5672
EXPOSE 9000
5773

58-
CMD ["/usr/bin/uwsgi","--http",":9000","-w","shipyard_airflow.shipyard","--callable","shipyard","--enable-threads","-L","--logto","uwsgi_shipyard.log"]
74+
# Set work directory
75+
USER shipyard
76+
WORKDIR ${SHIPYARD_HOME}/shipyard
77+
78+
# Execute entrypoint
79+
ENTRYPOINT ["/home/shipyard/entrypoint.sh"]
5980

shipyard/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
## Shipyard ##
2+
3+
Shipyard dockerfiles
4+

shipyard/entrypoint.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
#
3+
# Copyright 2017 AT&T Intellectual Property. All other 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+
17+
18+
# Start shipyard application
19+
/usr/local/bin/uwsgi --http :9000 -w shipyard_airflow.shipyard --callable shipyard --enable-threads -L
20+

shipyard/shipyard.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[BASE]
2+
WEB_SERVER=http://localhost:32080
3+

0 commit comments

Comments
 (0)