Skip to content
This repository has been archived by the owner on Sep 22, 2023. It is now read-only.

Commit

Permalink
update docker-compose and dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
itsmostafa committed Feb 1, 2023
1 parent 423f578 commit b1e1739
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 46 deletions.
43 changes: 9 additions & 34 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG VERSION=unspecified

FROM python:3.10.1-alpine
FROM alpine:3

ARG VERSION

Expand All @@ -16,7 +16,7 @@ ARG VERSION
# suggested that you use an email address here that is specific to the
# person or group that maintains this repository; for example:
# LABEL org.opencontainers.image.authors="vm-fusion-dev-group@trio.dhs.gov"
LABEL org.opencontainers.image.authors="github@cisa.dhs.gov"
LABEL org.opencontainers.image.authors="mostafa.abdelbaky@inl.gov"
LABEL org.opencontainers.image.vendor="Cybersecurity and Infrastructure Security Agency"

###
Expand Down Expand Up @@ -53,40 +53,15 @@ RUN addgroup --system --gid ${CISA_GID} ${CISA_GROUP} \
ENV DEPS \
ca-certificates \
openssl \
py-pip
wget
RUN apk --no-cache --quiet add ${DEPS}

###
# Make sure pip and setuptools are the latest versions
#
# Note that we use pip --no-cache-dir to avoid writing to a local
# cache. This results in a smaller final image, at the cost of
# slightly longer install times.
###
RUN pip install --no-cache-dir --upgrade pip setuptools
# Install Con-PCA-Tasks binary file
RUN wget https://github.com/cisagov/con-pca-tasks/releases/download/v0.0.1/pca-linux-amd64
RUN mv pca-linux-amd64 /bin/pca

WORKDIR ${CISA_HOME}

###
# Install Python dependencies
#
# Note that we use pip --no-cache-dir to avoid writing to a local
# cache. This results in a smaller final image, at the cost of
# slightly longer install times.
###
RUN wget --output-document sourcecode.tgz \
https://github.com/cisagov/skeleton-python-library/archive/v${VERSION}.tar.gz \
&& tar --extract --gzip --file sourcecode.tgz --strip-components=1 \
&& pip install --no-cache-dir --requirement requirements.txt \
&& ln -snf /run/secrets/quote.txt src/example/data/secret.txt \
&& rm sourcecode.tgz

###
# Prepare to run
###
ENV ECHO_MESSAGE="Hello World from Dockerfile"
RUN ["chmod", "+x", "/bin/pca"]
USER ${CISA_USER}
EXPOSE 8080/TCP
VOLUME ["/var/log"]
ENTRYPOINT ["example"]
CMD ["--log-level", "DEBUG"]

ENTRYPOINT ["/bin/pca"]
14 changes: 2 additions & 12 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,9 @@ services:
# VERSION must be specified on the command line:
# e.g., --build-arg VERSION=0.0.1
context: .
dockerfile: Dockerfile
image: cisagov/example
container_name: pca-tasks
init: true
restart: "no"
environment:
- ECHO_MESSAGE=Hello World from docker compose!
restart: unless-stopped
ports:
- target: 8080
published: 8080
Expand All @@ -28,10 +25,3 @@ services:
secrets:
- source: quote_txt
target: quote.txt

example-version:
# Run the container to collect version information
image: cisagov/example
init: true
restart: "no"
command: --version

0 comments on commit b1e1739

Please # to comment.