Skip to content

Commit

Permalink
Update main.py to recive parameters as docker flags
Browse files Browse the repository at this point in the history
  • Loading branch information
Andresmup committed Jun 2, 2024
1 parent 1b502fe commit 0324ca8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ RUN pip install --no-cache-dir -r requirements.txt
# Copy the rest of the application code into the container
COPY . .

# Run the application
# Default command
ENTRYPOINT ["python", "main.py"]
10 changes: 5 additions & 5 deletions Docker/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ def main(source_bucket, source_file, destination_bucket, destination_file):

s3.put_object(Bucket=destination_bucket, Key=destination_file, Body=json_data)

if __name__ == "__main__":
f __name__ == "__main__":
parser = argparse.ArgumentParser(description="Source and destination, bucket and file are required.")
parser.add_argument("source_bucket", help="Source bucket is required")
parser.add_argument("source_file", help="Source file name is required")
parser.add_argument("destination_bucket", help="Destination bucket is required")
parser.add_argument("destination_file", help="Destination file name is required")
parser.add_argument("--source_bucket", required=True, help="Source bucket is required")
parser.add_argument("--source_file", required=True, help="Source file name is required")
parser.add_argument("--destination_bucket", required=True, help="Destination bucket is required")
parser.add_argument("--destination_file", required=True, help="Destination file name is required")
args = parser.parse_args()
main(args.source_bucket, args.source_file, args.destination_bucket, args.destination_file)

0 comments on commit 0324ca8

Please sign in to comment.