diff --git a/Dockerfile b/Dockerfile index 0d643e499a..a35045d02a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,17 @@ +# Copyright 2022 Codenotary Inc. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + FROM golang:1.18 as build WORKDIR /src COPY go.mod go.sum /src/ @@ -7,50 +21,7 @@ RUN rm -rf /src/webconsole/dist RUN GOOS=linux GOARCH=amd64 WEBCONSOLE=default make immuadmin-static immudb-static RUN mkdir /empty -FROM debian:bullseye-slim as bullseye-slim -LABEL org.opencontainers.image.authors="Codenotary Inc. " - -COPY --from=build /src/immudb /usr/sbin/immudb -COPY --from=build /src/immuadmin /usr/local/bin/immuadmin -COPY --from=build "/etc/ssl/certs/ca-certificates.crt" "/etc/ssl/certs/ca-certificates.crt" - -ARG IMMU_UID="3322" -ARG IMMU_GID="3322" - -ENV IMMUDB_HOME="/usr/share/immudb" \ - IMMUDB_DIR="/var/lib/immudb" \ - IMMUDB_ADDRESS="0.0.0.0" \ - IMMUDB_PORT="3322" \ - IMMUDB_PIDFILE="" \ - IMMUDB_LOGFILE="" \ - IMMUDB_MTLS="false" \ - IMMUDB_AUTH="true" \ - IMMUDB_DETACHED="false" \ - IMMUDB_DEVMODE="true" \ - IMMUDB_MAINTENANCE="false" \ - IMMUDB_ADMIN_PASSWORD="immudb" \ - IMMUDB_PGSQL_SERVER="true" \ - IMMUADMIN_TOKENFILE="/var/lib/immudb/admin_token" - -RUN addgroup --system --gid $IMMU_GID immu && \ - adduser --system --uid $IMMU_UID --no-create-home --ingroup immu immu && \ - mkdir -p "$IMMUDB_HOME" && \ - mkdir -p "$IMMUDB_DIR" && \ - chown -R immu:immu "$IMMUDB_HOME" "$IMMUDB_DIR" && \ - chmod -R 777 "$IMMUDB_HOME" "$IMMUDB_DIR" && \ - chmod +x /usr/sbin/immudb /usr/local/bin/immuadmin - -EXPOSE 3322 -EXPOSE 9497 -EXPOSE 8080 -EXPOSE 5432 - -HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 CMD [ "/usr/local/bin/immuadmin", "status" ] -USER immu -ENTRYPOINT ["/usr/sbin/immudb"] - - -FROM scratch as scratch +FROM scratch LABEL org.opencontainers.image.authors="Codenotary Inc. " ARG IMMU_UID="3322"