-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
254 additions
and
7 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,26 @@ | ||
**/__pycache__ | ||
**/.venv | ||
**/.classpath | ||
**/.dockerignore | ||
**/.env | ||
**/.git | ||
**/.gitignore | ||
**/.project | ||
**/.settings | ||
**/.toolstarget | ||
**/.vs | ||
**/.vscode | ||
**/*.*proj.user | ||
**/*.dbmdl | ||
**/*.jfm | ||
**/bin | ||
**/charts | ||
**/docker-compose* | ||
**/compose* | ||
**/Dockerfile* | ||
**/npm-debug.log | ||
**/obj | ||
**/secrets.dev.yaml | ||
**/values.dev.yaml | ||
LICENSE | ||
README.md |
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,49 @@ | ||
FROM python:3.10-slim | ||
|
||
# Set a working directory inside the container | ||
WORKDIR /app | ||
|
||
RUN apt-get clean | ||
|
||
RUN apt-get update \ | ||
-o Acquire::http::No-Cache=true \ | ||
-o Acquire::http::Pipeline-Depth=0 \ | ||
-o Acquire::BrokenProxy=true \ | ||
&& apt-get install -y --no-install-recommends \ | ||
-o Acquire::http::No-Cache=true \ | ||
-o Acquire::http::Pipeline-Depth=0 \ | ||
-o Acquire::BrokenProxy=true \ | ||
wget \ | ||
tar \ | ||
unzip \ | ||
gcc \ | ||
make \ | ||
libpq-dev \ | ||
git \ | ||
postgresql-server-dev-all \ | ||
&& rm -rf /var/lib/apt/lists/* # Clean up to reduce the image size | ||
|
||
# Download Flyway CLI | ||
RUN wget https://repo1.maven.org/maven2/org/flywaydb/flyway-commandline/11.0.0/flyway-commandline-11.0.0-linux-x64.tar.gz && \ | ||
tar -xvf flyway-commandline-11.0.0-linux-x64.tar.gz && \ | ||
mv flyway-11.0.0 /flyway && \ | ||
ln -s /flyway/flyway /usr/local/bin/flyway && \ | ||
rm flyway-commandline-11.0.0-linux-x64.tar.gz | ||
|
||
|
||
# Copy application files | ||
COPY . /app | ||
|
||
|
||
# Install Python dependencies from requirements.txt | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
RUN pip install --no-cache-dir -r requirements-dev.txt | ||
|
||
# Expose ports for flask and locust | ||
EXPOSE 5000 | ||
EXPOSE 8089 | ||
|
||
# Add Python path environment variable | ||
ENV PYTHONPATH "${PYTHONPATH}:/app" | ||
|
||
CMD ["flask", "run"] |
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# More information on the parameters can be found here: https://documentation.red-gate.com/flyway/flyway-cli-and-api/configuration/parameters | ||
|
||
[environments.local] | ||
url = "jdbc:postgresql://db:5432/cfdm_test" | ||
user = "postgres" | ||
password = "password" | ||
# jarDirs = ["path/to/java/migrations"] | ||
# driver = | ||
# schemas = | ||
# connectRetries = | ||
# connectRetriesInterval = | ||
# initSql = | ||
# jdbcProperties = | ||
# resolvers = | ||
|
||
[flyway] | ||
environment = "local" | ||
locations = ["filesystem:/app/data/migrations"] | ||
|
||
# [environments.build] | ||
# url = "jdbc:sqlite::memory:" | ||
# user = "buildUser" | ||
# password = "buildPassword" | ||
|
||
# [flyway.check] | ||
# buildEnvironment = "build" |
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,95 @@ | ||
services: | ||
openfec: | ||
platform: linux/amd64 | ||
build: | ||
context: . | ||
ports: | ||
- "5000:5000" | ||
- "8089:8089" | ||
environment: | ||
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} | ||
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} | ||
- AWS_PUBLIC_BUCKET=${AWS_PUBLIC_BUCKET} | ||
- AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION} | ||
- FEC_API_URL=http://localhost:5000 | ||
- FEC_CMS_URL=http://localhost:8000 | ||
- FEC_DOWNLOAD_API_KEY=${FEC_DOWNLOAD_API_KEY} | ||
- FEC_WEB_API_KEY_PUBLIC=${FEC_WEB_API_KEY_PUBLIC} | ||
- FLASK_APP=webservices.rest.py | ||
- FLASK_DEBUG=1 | ||
- FLASK_RUN_HOST=0.0.0.0 | ||
- IS_USING_DOCKER=true | ||
- SLACK_HOOK=${SLACK_HOOK} | ||
- SQLA_CONN=${SQLA_CONN} | ||
- SQLA_DOCKER_DB_CONN=${SQLA_DOCKER_DB_CONN} | ||
- SQLA_SAMPLE_DB_CONN=${SQLA_SAMPLE_DB_CONN} | ||
- SQLA_TEST_CONN=${SQLA_TEST_CONN} | ||
volumes: | ||
- .:/app | ||
|
||
db: | ||
image: postgres:13 | ||
environment: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: password | ||
POSTGRES_DB: localdb | ||
volumes: | ||
- pgdata:/var/lib/postgresql/data | ||
ports: | ||
- "5432:5432" | ||
|
||
elasticsearch: | ||
image: docker.elastic.co/elasticsearch/elasticsearch:7.4.0 | ||
platform: linux/amd64 | ||
environment: | ||
- discovery.type=single-node | ||
- http.cors.enabled=true | ||
- http.cors.allow-origin=* | ||
- http.cors.allow-headers=X-Requested-With, Content-Type, Content-Length, Authorization | ||
- http.cors.allow-methods=OPTIONS, HEAD, GET, POST, PUT, DELETE | ||
- discovery.type=single-node | ||
volumes: | ||
- esdata:/usr/share/elasticsearch/data | ||
ports: | ||
- "9200:9200" | ||
|
||
redis: | ||
image: redis:6.2 | ||
command: redis-server --save 60 1 --loglevel warning | ||
ports: | ||
- "6379:6379" | ||
|
||
celery-worker: | ||
build: | ||
context: . | ||
command: celery -A webservices.tasks worker --loglevel=info | ||
environment: | ||
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} | ||
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} | ||
- AWS_PUBLIC_BUCKET=${AWS_PUBLIC_BUCKET} | ||
- AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION} | ||
- CELERY_BROKER_URL=redis://redis:6379/0 | ||
- CELERY_RESULT_BACKEND=redis://redis:6379/0 | ||
- IS_USING_DOCKER=true | ||
- SQLA_DOCKER_DB_CONN=${SQLA_DOCKER_DB_CONN} | ||
depends_on: | ||
- redis | ||
volumes: | ||
- .:/app | ||
|
||
celery-beat: | ||
build: | ||
context: . | ||
command: celery -A webservices.tasks beat --loglevel=info | ||
environment: | ||
- CELERY_BROKER_URL=redis://redis:6379/0 | ||
- CELERY_RESULT_BACKEND=redis://redis:6379/0 | ||
- IS_USING_DOCKER=true | ||
depends_on: | ||
- redis | ||
volumes: | ||
- .:/app | ||
|
||
volumes: | ||
pgdata: | ||
esdata: |
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