-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #147 from raphaelrpl/b-1.0
Review Dockerfile setup and prepare to release 1.0 🚀
- Loading branch information
Showing
20 changed files
with
374 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# IDE - VSCode | ||
.vscode/* | ||
!.vscode/settings.json | ||
!.vscode/tasks.json | ||
!.vscode/launch.json | ||
!.vscode/extensions.json | ||
.history/* | ||
.vscode | ||
|
||
data-cube-manager/node_modules/ | ||
deploy/dist/ | ||
data-cube-manager/src/assets/env.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,62 @@ | ||
FROM golang:1.15 | ||
# | ||
# This file is part of Data Cube Manager. | ||
# Copyright (C) 2023 INPE. | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <https://www.gnu.org/licenses/gpl-3.0.html>. | ||
# | ||
|
||
RUN mkdir /usr/src/app | ||
ARG GIT_COMMIT | ||
ARG BASE_IMAGE=node:16-bullseye | ||
FROM ${BASE_IMAGE} AS node | ||
|
||
COPY dist /usr/src/app/dist | ||
COPY server.go /usr/src/app/ | ||
LABEL "org.repo.maintainer"="Brazil Data Cube <brazildatacube@inpe.br>" | ||
LABEL "org.repo.title"="Docker image for Data Cube Builder GUI" | ||
LABEL "org.repo.description"="Docker image for Data Cube Builder Graphical User Interface." | ||
LABEL "org.repo.git_commit"="${GIT_COMMIT}" | ||
|
||
# Build arguments | ||
## Base URL for image. Defaults to "/" | ||
ARG DC_MANAGER_BASE_URL=/ | ||
|
||
# Add sources into container and build | ||
COPY ./data-cube-manager /build/data-cube-manager | ||
|
||
WORKDIR /build/data-cube-manager | ||
|
||
RUN npm install && \ | ||
npm run build -- --prod --base-href ${DC_MANAGER_BASE_URL} --deploy-url ${DC_MANAGER_BASE_URL} | ||
|
||
|
||
# Final small image | ||
FROM python:3.11-alpine | ||
|
||
# Build arguments | ||
ARG DC_MANAGER_VERSION="1.0.0" | ||
ARG DC_MANAGER_INSTALL_PATH="/opt/dc-manager/${DC_MANAGER_VERSION}" | ||
ENV DC_MANAGER_BASE_URL="/" | ||
ENV DC_MANAGER_VERSION=${DC_MANAGER_VERSION} | ||
ENV DC_MANAGER_INSTALL_PATH=${DC_MANAGER_INSTALL_PATH} | ||
# Defaults to local mode (on-premise services). Use "cloud" for AWS setup. | ||
ENV DC_MANAGER_MODE=local | ||
|
||
COPY --from=node /build/deploy/dist ${DC_MANAGER_INSTALL_PATH} | ||
COPY ./deploy/app.py ${DC_MANAGER_INSTALL_PATH} | ||
|
||
WORKDIR ${DC_MANAGER_INSTALL_PATH} | ||
|
||
RUN pip install flask gunicorn beautifulsoup4 --no-cache-dir | ||
|
||
WORKDIR /usr/src/app | ||
EXPOSE 8080 | ||
|
||
RUN go build -o main . | ||
CMD ["./main"] | ||
CMD ["gunicorn", "-w4", "--bind", "0.0.0.0:8080", "app:app", "--max-requests=256"] |
Oops, something went wrong.